开发者

placing text into title tag w/jQuery

I think it is possible, just can't seem to be able to find how to do it. I need to pass a value into a title of a span with jQuery...

I already pass the width to it:

$开发者_JAVA百科("#mySpan").width(myWidth);

<span id="mySpan" title=""></span>


$('#myspan').attr('title', 'sometitle');


$("#mySpan").attr('title', 'some value');

or

document.getElementById('mySpan').title = 'some value';


You can do this -

$("#mySpan").attr("title", "yourValueHere");

This should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜