Javascript has the = symbol, which represents the assignment operator and is used to assign values to JavaScript variables. Its usage is as follows: "var x=10;var y=5;x=y;var demoP=document.getElementById (...)".
The operating environment of this article: Windows 7 system, javascript version 1.8.5, Dell G3 computer.
Does javascript have =?
javascript has = symbol.
JavaScript assignment operator
The assignment operator is used to assign values to JavaScript variables.
Code example:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <p>设置 x=10 和 y=5, 计算 x=y, 并显示结果。</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { var x=10; var y=5; x=y; var demoP=document.getElementById("demo") demoP.innerHTML="x=" + x; } </script> </body> </html>
Result:
js basic tutorial"
The above is the detailed content of Does javascript have =?. For more information, please follow other related articles on the PHP Chinese website!