This is my last question diabling a hyperlink. The hyperlink does disable but the problem is that is disabling all hyperlinks with the same class. All hyperlinks have the same class, if not then they won’t work. But I only want the hyperlink on top (in html) to be only disabled not the hyperlinks in the added rows (jquery code) to be disabled. How can I differenciate the 2 so that not all hyperlinks are disabled?
Below is code for disabling the hyperlink:
$(".showGrid").unbind('click').click(function (event) {
event.preventDefault();
return false;
})
Below is hyperlink in full html (I want this hyperlink to be disabled):
<table id="optionAndAnswer" class="optionAndAnswer">
<tr>
<th colspan="2">
Option and Answer
</th>
</tr>
<tr class="option">
<td>Option Type:</td>
<td>
<div class="box">
<input type="text" name="gridValues" class="gridTxt maxRow" readonly="readonly" />
<a href="#" class="showGrid">[Open Grid]</a>
</div>
</td>
</tr>
</table>
Below is hyperlink in jquery code (Don’t Disable this hyperlink):
function insertQuestion(form) {
var $tr = $("<tr class='optionAndAnswer' align='center'></tr>");
var $options = $("<td class='option'></td>");
$('.gridTxt', context).each( function() {
var $this = $(this);
var $optionsText = $("<input type='text' class='gridTxtRow maxRow' readonly='readonly' /><span href='#' class='showGrid'>[Open Grid]</span>").attr('name',$this.attr('name'))
.attr('value',$this.val())
$options.append($optionsText);
});
$tr.append($options);
}
Can you add a id and disable by using $(“#new_id”)?