Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我编写了一个头文件,其中包含一个用于搜索的输入文本框。这个头文件包含在 jsp 页面的 body 标记中,如下所示。
<body> <include src="header.ssi"> <form> </form>
onclick 按钮 i 头文件我正在运行一个 javascript 函数。我需要在 javascript 函数中引用这个文本框。
document.getElementById——但它应该是一种形式
document.getElementById
如果您可以使用 jQuery,那么只需使用$("#textboxid")来访问文本框
$("#textboxid")