Basic
HTML
<button id="btn">Click here</button>
<div id="alert_text">Error</div>
JavaScript
$(function () {
$("#btn").click(function(){
document.getElementById('alert_text').innerHTML='Showing alert message';});
});
<button id="btn">Click here</button>
<div id="alert_text">Error</div>
$(function () {
$("#btn").click(function(){
document.getElementById('alert_text').innerHTML='Showing alert message';});
});