Does $(selector).attr(name)
guarantee that the result is lowercase if the attribute is found?
It will return the value in whatever case it was set.
<div class="sOmEcLaSs">content</div>
.
alert( $('div').attr('class') ); // will alert sOmEcLaSs
If you want to convert to lowercase, you can use .toLowerCase()
.
alert( $('div').attr('class').toLowerCase() ); // will alert someclass
Code for jQuery's attr
return statements (not Sizzle):
http://github.com/jquery/jquery/blob/1.4.2/src/attributes.js#L308
or
http://github.com/jquery/jquery/blob/1.4.2/src/attributes.js#L325
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With