How do I change or remove style “width” property for img?
HTML:
<div class="main_box_img">
<img src="...">
</div>
CSS:
.main_box_img img{
width: 100%;
}
document.getElementsByClassName("main_box_img")[0].getElementsByTagName('img')[0].style
is empty.
I can get width value using getComputedStyle()
, but it’s read-only.
Seems to be a simple question but I’ve found nothing.