Data Message
Solution for EE - Q_27935749
by ChrisStanyon
HTML
<div class='msgTrue' style='background-color:#eee;' data-message='This is the message for the first DIV'>
This is the first DIV
</div>
<div class='msgTrue' style='background-color:#eee;' data-message='This is the message for the second DIV'>
This is the second DIV
</div>
<div class='msgTrue' style='background-color:#eee;' data-message='This is the message for the third DIV'>
This is the third DIV
</div>
<div id='msgTrueSubj'>The message goes here</div>
JavaScript
$(".msgTrue").click(function() {
$("#msgTrueSubj")
.html( '<div style="width:75%;margin-top:25px;">'+$(this).data('message')+'</div>' )
.show();
});