例如,您可以写 <a href="" onclick="javascript:.." >
但是当你写 <a href="" onclick="user:4523234" >
时会发生什么
我刚刚在 html 代码中发现了这个,但我不明白它的作用。
感谢您的帮助。
最佳答案
会发生什么?没有什么。
这只是一个named label
label : statement Parameters
label
Any JavaScript identifier that is not a reserved word.
statement
Statements. break can be used with any labeled statement, and continue can be used with looping labeled statements.
如果它是一个 href,那么它将是 custom protocol就像
<a href="mailto:foo@example.com">
关于javascript - "user:something"在 JavaScript onclick 事件中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20520678/