How do I check if an element exists if the element is created by
$('elemId').lengthdoesn't work for me.
You need to put
# before element id:
document.getElementById('id_here') , however when using jQuery, you do need to put hash to target elements based on
id just like CSS.