开发者

JQuery loop through <link> and <script>

开发者 https://www.devze.com 2023-01-27 11:43 出处:网络
I am trying 开发者_如何学Pythonto loop through the elements link and script tag $(\"script\").each(function () {

I am trying 开发者_如何学Pythonto loop through the elements link and script tag

$("script").each(function () {
 alert("Test");
});

The code works for img tag but does work for the above 2?


Try this:

$("script, link").each(function () {
   alert($(this).attr('type')); //:)
});
0

精彩评论

暂无评论...
验证码 换一张
取 消