开发者

How can I parse jQuery variable that has the value of attr("title") back to HTML

I have got a variable called name here

Name = $(this).attr("title");

I need to parse this back to HTML, i.e.

N开发者_如何学JAVAudging <script>document.write (Name);</script>

But its not working, I think its something to do with scopes


Instead of:

Nudging <script>document.write (Name);</script>

Use something like:

Nudging <span id="someId"></span>

And this line of jQuery:

$("#someId").html(Name);

Check what exactly this is supposed to select in your expression. In the code at the URL you give, you could select like this:

Name = $(".alertdim").attr("title");

See the jQuery selectors reference here: http://api.jquery.com/category/selectors/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜