Adding an onclick function to go to url in JavaScript?

前端 未结 9 1261
北荒
北荒 2020-11-29 18:28

I am using this fancy little JavaScript to highlight a field as the user hovers over it. Could you please tell me if there is a way of adding an onclick functio

9条回答
  •  Happy的楠姐
    2020-11-29 18:57

    Try

     window.location = url;
    

    Also use

     window.open(url);
    

    if you want to open in a new window.

提交回复
热议问题