selector - jquery how do i reach element id when element is stored in variable -


is possible element id when element stored in variable?

var element = $("#someelement") var id = element.id(); 

if have not working. element stored in variable, not in dom right now.

id property of element #someelement, not method of jquery collection $("#someelement").

therefore

var id = element.prop('id'); 

or

var id = element.get(0).id; 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -