Should I use [removed] or .value for <textarea>?

前端 未结 3 1078
难免孤独
难免孤独 2020-12-20 22:10

This is a follow-up of Does this not work because I can't use a script in a div?

Where I left off, I had this code:
Button script:



        
3条回答
  •  春和景丽
    2020-12-20 22:23

    You access and update the value of a textarea element through the "value" property.

    Try:

     var theValue = document.getElementById("editorHead").value;
    

    Updating the element doesn't make much sense.

提交回复
热议问题