<!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> <script> function buttonCol_1(){ var col_1 = document.getElementById("col_1").value; var col_1_result = document.getElementById("col_1_result"); col_1_result.innerHTML = '<div class="ibm-col-'+col_1+'">'+' '+'</div>'; /*输出效果:<div class="ibm-col-6-5"> </div>*/ } function buttonCol_2(){ var col_2 = document.getElementById("col_2").value; var col_2_result = document.getElementById("col_2_result") col_2_result.innerHTML = '<div class="ibm-col-'+col_2+'">'+' '+'</div>'; /*输出效果:<div class="ibm-col-6-5"> </div>*/ } </script> </head> <body> <input type="text" size="40" placeholder="col-?-?" id="col_1"> <br/> <br/> <input type="text" size="40" placeholder="col-?-?" id="col_2"> <br/> <br/> <input type="button" value="Get col_1" onclick="buttonCol_1()"> <input type="button" value="Get col_2" onclick="buttonCol_2()"> <br/> <br/> <div id="col_1_result"> </div> <div id="col_2_result"> </div> </body> </html>
chanway
qq_舎吥得_0
丶小八戒
相关分类