Created
July 29, 2021 13:38
-
-
Save rodrigophpweb/4e967df8d66f9498c22d799610073c00 to your computer and use it in GitHub Desktop.
Function get all class with same name more width and height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setDisplay(className, widthValue, heightValue) { | |
//Get All Class same name | |
var items = document.getElementsByClassName(className); | |
//Loop to Class | |
for (var i=0; i < items.length; i++) { | |
//Change Attributes Width and Height | |
items[i].style.width = widthValue; | |
items[i].style.height = heightValue; | |
} | |
} | |
//Callback with parameters | |
setDisplay('wp-caption', '100%', 'auto') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment