Can Somebody please tell me why this script is not working.. Its supposed to work, but doesnt, I am getting the id correctly, but Div's are not displaying properly.. My idea is to display one div based on the click, and hide the other Div's. Please help..
Script
$(document).ready(function() {
$("a").live("click", function(){
var idV = $(this).attr("id");
alert(idV);
$("#"+idV+"div").css("display","block");
return false;
});
});
HTML
<a href="#" id="solution1">Solution 1</a>
<a href="#" id="solution2">Solution 2</a>
<a href="#" id="solution3">Solution 3</a>
<a href="#" id="solution4">Solution 4</a>
<br />
<div id="solution1" style="display:none;">Solution 1</div>
<div id="solution2" style="display:none;">Solution 2</div>
<div id="solution3" style="display:none;">Solution 3</div>
<div id="solution4" style="display:none;">Solution 4</div>