开发者

placing text into title tag w/jQuery

开发者 https://www.devze.com 2023-03-15 04:26 出处:网络
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 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

精彩评论

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