我们必须在我们的HTML的JavaScript函数这个标签,如何调用javascript函数内的jQuery
<select name="My_Saved_Billing" onchange="Choose_My_Saved_Billing(this.selectedIndex)" >
<option>Select</option>
<option value="1714">Address line 1, QC</option>
</select>
<script type="text/javascript">
function Choose_My_Saved_Billing(arg_index) {
switch(arg_index) {
// some commands here
}
}
</script>
而且我还添加了一个jQuery它是下面这样,在Windows加载,它会自动选择第二种选择。
<script type="text/javascript">
$(window).load(function(){
$("select").val($("select option:eq(1)").val());
});
</script>
但是有可能使用jQuery调用javascript函数吗?如果是这样,我应该怎么称呼这个?
我应该使用Choose_My_Saved_Billing(this.selectedIndex)
还是Choose_My_Saved_Billing(arg_index)
或者您可能知道一些事情。我试过这两个,但都没有工作。请告诉我。这里只是一个初学者。
我欣赏的帮助。但似乎没有任何工作。 –