Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$.fn.extend({
convert_string: function (str) {
return $('<div/>').text(str).html();
}
});
$("button").click(function(){
console.log($(".div1").text($(this).convert_string(">")));
});
});
</script>
</head>
<body>
<button>click</button>
<hr>
<div>Result:</div>
<hr>
<div class="div1"></div>
</body>
</html>
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY Click to see more ... 10.5K 1.8K