Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem using hasClass in JQuery (JavaScript simply crashes)

Status
Not open for further replies.

maxdeveloper

Programmer
Jun 28, 2010
2
US
I'm trying to use hasClass to test whether an element has the class "selected": the first alert verifies that the node was retrieved correctly, the second alert crashes...I can't figure out why...

Code:
var target_node=event.target;
alert("name is:"+target_node.getAttribute("name"));
alert(target_node.hasClass("selected"));

and yes, I did include JQuery.js
 
solved it, jus wrap it with $() to turn html object into jquery object
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top