Div tag actions using JQuery.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
// Function which is called on div click
function MyFunction()
{
alert("Div Clicked");
};
$(document).ready(function()
{
// Adding text to Div tag
$('#MyDiv').text('Add to Favorites Conformation');
// Changing div color
$('#MyDiv').css("background-color", "yellow");
// Adding Click event to div tag
$("#MyDiv").attr("onclick", 'MyFunction()');
// Empty the Div content
$('#divContainer').empty();
// Adding html code to div
$("#myEmptyDiv").html("<h2>Ramakrishna Basagalla</h2>");
});
</script>
</head>
<body>
<div id="MyDiv">MyDivTag</div>
<div id="divContainer">My Default text</div>
<div id="myEmptyDiv"></div>
</body>
</html>