javascript - How to find active tag formats using jQuery? -
i have situation sample code follows:
<html> <head> <title>untitled document</title> </head> <body> <p> <h1>the header</h1> <div> matter ia matter matter ia <strong>bold matter</strong> matter matter <em>italics matter</em>matter ia <em><strong>bold italics matter</strong></em>lways matter </div> </p> </body> </html> i trying retrieve specific tags body->p->div->em->strong when click on "bold italics matter" using jquery. there standard method retrieve per click event?
if wan tag name of element clicked, can use:
$('*').click(function(e) { e.stoppropagation(); console.log($(this).prop('tagname')); });
Comments
Post a Comment