Change the width of a Div by selecting the Div attribute

I have the following Div, which have an attribute named data-automation-id:-

enter image description here

now i want using javascript to set the width of this Div to be 50% then back to 75% instead of 100%? but i am not sure how i can select a Div using an attribute?


You can do this :


Or with Jquery:


Leave a Reply

Your email address will not be published. Required fields are marked *