我感覺沒有錯誤,為什么點擊按鈕不能按照要求顯示和隱藏<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>顯示及隱藏</title></head><body><script type="text/javascript">var Q=document.getElementById("q");Q.style.color="red";function x(){?Q.style.display="none";}function y(){?Q.style.display="block";}<h2 id="q">窮</h2></script><p>想住的好,為什么不買個別墅呢?</br>因為</p><form><input type="button" onclick="x()" value="tell me" /><input name="按鈕" type="button" onclick="y()" value="not my bussiness" /></form></body></html>
js顯示與隱藏
慕粉13727861792
2017-01-24 20:32:53