JQuery - Can we capture both the p and div tags at a time in a single sentence using jquery?
Use the comma selector:
$("div, p")...
or add()
:
$("div").add("p")...
......
$('p, div')..........
Just separate each item with a comma (,
).
Alternatively, you could use the add function:
$('p').add('div')..........
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With