Passing HTML input value as a JavaScript Function Parameter

后端 未结 7 1800
别跟我提以往
别跟我提以往 2020-12-13 15:52

I am new to JavaScript, and I\'m trying to figure out how to pass user-inputted values as a parameter to a JavaScript function. Here is my code:

         


        
7条回答
  •  不思量自难忘°
    2020-12-13 16:16

    do you use jquery? if then:

    $('#xx').val();
    

    or use original javascript(DOM)

    document.getElementById('xx').value
    

    or

    xxxform.xx.value;
    

    if you want to learn more, w3chool can help you a lot.

提交回复
热议问题