JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<container>
<div id='1'>Text1</div>
<div id='2'>Text2</div>
</container>
</body>
CSS
div {
width:100px;
margin:10px;
background:#E9E9E9;
border:1px solid silver;
padding:1%;
text-align:center
}
JavaScript
$(function notice_it(declim) {
$('body').on('click', '#1', function (event) {
event.stopPropagation();
var declim = 10 - 1;
notify(declim);
});
$('body').on('click', '#2', function (event) {
event.stopPropagation();
var declim = 10 + 1;
notify(declim);
});
$('body').on('click', 'body', function (e) {
e.stopPropagation();
});
});
function notify(declim){
if ($.isNumeric(declim)) {
//stuff
} else {
declim = 10;
}
$("#container").html("<div id='1'>Text1</div><div id='2'>Text2</div>");
alert(declim);
}