jQuery Attribute Exists

[Jul 18, 2010]


To check if the attribute exists in specific element, you can test if it is not equal to undefined.

if (jQuery("#id").attr("onclick") != undefined) { }

http://stackoverflow.com/questions/1097522/check-existence-of-an-attribute-with-...


Home
Web Log
Contact Me
© 2008-2012 Khomsan Phongphisansakun
May 19th, 2012