javascript - Any possibilities for hasClass Name make true all the child elements -


if(element.toelement.classname == 'section') 

if class name matches section want when user clicks child elements of section div want make true condition.

when user click div need check class name if class name match need execute function.

but issue when user click child element of matched class going else condition.

any possibilities on there??

try this

$(this).parents().hasclass('section'); 

Comments

Popular posts from this blog

Add new key value to json node in java -

javascript - Highcharts Synchronized charts with missing data points -

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -