-
-
Save dirkakrid/8122d428f44104a7ae8b84c723fa8d21 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>Responsive Images</title> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<img src="example.png"/> | |
<img src="example2.png"/> | |
<img src="example3.png"/> | |
<script> | |
var totalImg = document.getElementsByTagName("img").length; | |
for(var i = 0; i < totalImg; i++){ | |
var img = document.getElementsByTagName("img")[i]; | |
var att = document.createAttribute("class"); | |
att.value = "img-responsive"; | |
img.setAttributeNode(att); | |
} | |
</script> | |
</body> | |
<html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment