$(document).ready(function()
{
$("#cover img").click(function(event)
{
var selected_script = $(this).attr('id');
//alert(selected_script);
//alert('#run_'+selected_script);
$('#run_'+selected_script).hide();
});
});
<div>
<img id="run_0" src="play.png" />
</div>
上面的代碼在單擊時不會隱藏圖像。當我提醒時,我得到了正確的身份證號碼。單擊時隱藏元素
我錯過了什麼?
感謝
是否顯示了這些警報? – hunter
你想隱藏相同的圖像,你點擊? –
你想隱藏什麼?你能顯示相關的HTML嗎?根據你的代碼你應該有一個id ='run_run_0' –