How to Get Value of Div Content Using jQuery

Hello guys, if you want to get value of div content using jQuery then you can fulfil your need using this example. Just check out this tutorial.

HTML

<div class="readonly_label" id="example">
        Other
 </div>

JQUERY

First include jQuery library

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var divContent = $('#example').text();
alert(divContent);
});
</script> 

Read Also: How To Write a Hello World Program in JavaScript

Leave a Comment