我有一个按钮
<button class="modalInput" rel="#prompt" onClick="params(1,2,'test','test2');">User input</button>
JavaScript 调用:
<script>
function params(a,b,c,d) {
var catid = a;
var id = b;
var text1 = c;
var text2 = d;
}
模态窗口:
$(document).ready(function() {
var triggers = $(".modalInput").overlay({
<div class="modal" id="prompt">
<form>
<div>
<table>
<tr>
<td>Question:</td><td><input value=text1 name="question" maxlength="80" size="40"/></td>
</tr>
<tr>
<td>Answer:</td><td><input value=text2 name="answer" maxlength="40" size="40"/></td>
</tr>
</table>
<input type="hidden" name="catid" value=catid />
<input type="hidden" name="id" value=id />
<script>
alert (text1);
document.getElementByName('question').value = text1;
</script>
我以为我可以在最后做脚本部分,但这不起作用......那么,我做错了什么?最后一个脚本部分根本没有执行......