<!--當點擊相應按鈕,執(zhí)行相應操作,為按鈕添加相應事件-->
????<input?type="button"?value="改變顏色"?onclick="changeColor()">??
????<input?type="button"?value="改變寬高"?onclick="changeS()">
????<input?type="button"?value="隱藏內(nèi)容"?onchick="hide()">
????<input?type="button"?value="顯示內(nèi)容"?onclick="show()">
????<input?type="button"?value="取消設置"?onclick="clearN()">
??</form>
??<script?type="text/javascript">
??var?d=document.getElementById("txt");
//定義"隱藏內(nèi)容"的函數(shù)
function?hide(){
????d.style.display="none";
}
//定義"顯示內(nèi)容"的函數(shù)
function?show(){
????d.style.display="block";
}
2016-11-15
onclick寫錯了 你寫成onchick了
2022-03-27
少寫了參數(shù),無限循環(huán)了請確認一下你這個playground文件的platform是ios目測是osx的。