Passing HTML input value as a JavaScript Function Parameter

后端 未结 7 1804
别跟我提以往
别跟我提以往 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:12

    Firstly an elements ID should always be unique. If your element IDs aren't unique then you would always get conflicting results. Imagine in your case using two different elements with the same ID.

    a:
    b:

提交回复
热议问题