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

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

Assuming that the html contains the following structure:



         


        
4条回答
  •  [愿得一人]
    2021-01-29 12:43

    You can do this using something like this:

    document.getElementById("abc").href="xyz.php";
    

    You will need to set an ID for the tag, so your tag will look like this:

        
    
    
    //
    提交回复
热议问题