たとえば、最後にあるIDを取得したいのですがどうすればいいですか?userInputの途中でどのように値を取得するのですか
<html>
<head>
<script>
function()
}
var userInput = document.getElementById("1").value;
window.alert("Your id is " + userInput
{
</script>
</head>
<body>
<input id="1" type="text" value="my id is 1743876">
</body>
<html>
値は常にその形式ですか?そうであれば、分割が機能します。さもなければ、正規表現が行く方法かもしれません。 – Gary