我們必須在我們的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)
或者您可能知道一些事情。我試過這兩個,但都沒有工作。請告訴我。這裏只是一個初學者。
我欣賞的幫助。但似乎沒有任何工作。 –