Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getElementsByClassName() method in JavaScript

<!DOCTYPE html>
<html>
<body>
<div class="myclass">The value is presented inside the class</div>
<button onclick="RetriveByClassName()" id="btnClick">Click</button>
<script>
function RetriveByClassName() {
var x = document.getElementsByClassName("myclass");
alert(x[0].innerHTML);
}
</script>
</body>
</html>
Source by www.enjoysharepoint.com #
 
PREVIOUS NEXT
Tagged: #method #JavaScript
ADD COMMENT
Topic
Name
3+5 =