how can the value of an href attribute be changed using javascript/css?

后端 未结 4 1226
陌清茗
陌清茗 2021-01-29 12:19

Assuming that the html contains the following structure:



         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 12:52

    Give the link an id text

    And then access it in your script: document.getElementById('linkToChange').href='newAddress';

提交回复
热议问题