我想要实现的是获得锚链接的名称,我已经做了,但由于一些奇怪的原因,它不会在if语句中工作。 我已经成功提醒锚名称,但不管它在if语句中不会出现什么内容。任何想法为什么?如果语句不工作在JQuery
感谢
echo "<br>
<div id='clicked_linked_$post_id_row' class='comment_field'>
<div id='showit_$post_id_row' style='display:none;'>
<form action='' method='POST''>
<textarea name='comment_post' class='comment_post'placeholder='What Is Your Thought?'></textarea>
<input type='hidden' name='post_id_value' id='post_id_value' class='post_id_value' value='$post_id_row'><br>
<input type='submit' value='Reply'>
</form>
</div>
<small> <a href='#' class='comment_link' id='$post_id_row'> Comment$post_id_row </a> </small>
</div><br>
";
JQuery的
$(document).ready(function() {
$('.comment_link').click(function() {
var t = $(this).text();
alert(t);
if($(this).text()=='Comment64') {
alert(9);
}
});
$(document).on("click", ".comment_link", function(){
var id = this.id;
$('#showit_'+id).fadeIn(1000);
return false;
});
});
这个问题是不可能理解的。请尽力写出正确的英文短语。 –
我基本上说,如果语句不工作在所有jquery –
你可以发布你的标记的锚。 – Mritunjay