劉任昌JavaScript,input,text,getElementById.
JavaScript輸出與輸入
輸入字串:
JavaScript輸出與輸入的程式碼
<p>輸入字串:<input type="text" len="50" id="in"></p><p><input type="button" value="執行JavaScript" onclick="f()"></p>
<p id="out"></p>
<script>
function f(){
var a = document.getElementById("in").value;/*取得id=in的文字*/
var b = "原字串: "+a+"<br>長度是:"+a.length+"<br>反串是: ";
var c = "";
for (var i = 0; i < a.length; i++)
c = a.slice(i,i+1) + c;
b = b +"<font size=7>" +c + "</font>";
document.getElementById("out").innerHTML = b;/*輸出html指令*/
}
</script>
https://xdrcfvghyujiok8945656.blogspot.com/2023/01/javascriptinputtextgetelementbyid.html
回覆刪除作者已經移除這則留言。
回覆刪除https://jdoifjopq1264.blogspot.com/2023/01/blog-post.html
回覆刪除https://yuzcc28.blogspot.com/2023/01/javascriptinputtextgetelementbyid.html
回覆刪除https://rtytrdtfg.blogspot.com/2023/01/javajavascriptinputtextbuttongetvalueby.html
回覆刪除https://d11150115.blogspot.com/2023/01/javascannerlengthcharat.html
回覆刪除https://wxxx17.blogspot.com/2023/01/javascriptinputtextgetelementbyid.html
回覆刪除https://643gjeytfru4312.blogspot.com/2023/01/javajavascriptinputtextbuttongetvalueby.html
回覆刪除https://d11150116.blogspot.com/2023/01/javascannerlengthcharat.html
回覆刪除https://tgyhjikolujik2554.blogspot.com/2023/01/h1bordersolid-5px-red-javascript.html
回覆刪除https://d11150113.blogspot.com/2023/01/javascript-function-f-var-document.html
回覆刪除