JQuery Can we capture both p and div tags at a time in the same sentence using jquery?
Use a comma selector:
$("div, p")...
or add():
add()
$("div").add("p")...
......
$('p, div')..........
Just separate each element with a comma ( ,).
,
Alternatively, you can use the add function :
$('p').add('div')..........