Is it possible to place a link inside <input> field?

后端 未结 9 760
温柔的废话
温柔的废话 2021-01-03 00:23

Is it possible to place links on Login and on Register here?



        
相关标签:
9条回答
  • 2021-01-03 00:46

    You could add a function call when clicking on it:

    <input type="text" onclick="navigate()" value="my-value" />
    
    ...
    function navigate(){
        window.open("my-url",'_blank');
    }
    
    0 讨论(0)
  • 2021-01-03 00:52

    No, inside input you can't use any tags. You can change input role or appearance, but it's a bad way.

    0 讨论(0)
  • 2021-01-03 00:58

    according to w3c, the end tag is forbidden on an input tag this means that you cannot place any element inside of an input tag

    http://www.w3.org/TR/html401/interact/forms.html

    0 讨论(0)
提交回复
热议问题