I created a new HTML element using jQuery.
var v=jQuery('<p>Hello</p>);
But when I try to get the nodeName of a new element,
v.nodeName.toLowerCase();
I get an error saying nodeName is undefined. What is wrong here?
Thanks.
v is a jQuery object containing a dom element, not a real dom element, you should do:
v
v[0].nodeName.toLowerCase();
Source: https://habr.com/ru/post/1310826/More articles:PHP mod rewrite.htaccess file godaddy.com question - phpBusiness Level Design - c #pass for tran 77 function in C / C ++ - c ++How can I make the GWT list box an editable part from the selection - gwtPassing contextual information to views in ASP.NET MVC - asp.net-mvcPHP variable for jquery function? - jqueryGrails gdoc editor support (esp IntelliJ) - vimZero and empty values โโ- c #Is it better to use GL_FIXED or GL_FLOAT on Android? - performanceDrupal Feeds featuring HTML encoded markup - drupalAll Articles