I want to set the same css for all of these div elements:
<div id="Some_id_1"></div>
<div id="Some_id_2"></div>
<div id="Some_id_3"></div>
How can I do that? thanks.
You should be able to use the jQuery Attribute Starts With Selector:
Usage:
$('[attribute^="value"]')
Example, fitting your needs:
$('div[id^="Some_id_"]').each(function(){
$(this).css('property','value');
});
This would be useful for setting these properties dynamically, however if you are just setting them in a static sense, I would recommend just applying a class="your_class" to all of your divs.
A Working Demo can be found here :
Demo
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