$("h2.trigger").click(function(){
console.log($(this));
$(this).toggleClass("active").next().slideToggle("slow");
var viewName=$(this).attr('id');
//display approval list ajax method
var html="";
I'm currently working on a jQuery application and do a console.log($(this));
In Firefox it prints
[h2#vw_hs_hr_wf_admin_data.trigger] this is a object
We can not take it as a plain string as it returns Object object. I would like to assign the "h2#vw_hs_hr_wf_admin_data.trigger" as a plain text to a JavaScript variable.
I tried
alert($(this).id);
alert($(this).0);
but I have no luck.
h2element? The text?h2element? How do you want to get the "value" given the name/id/whatever?