Home >Web Front-end >HTML Tutorial >Questions about javascript variable operation_html/css_WEB-ITnose
As shown in the figure, the variables move and variable a are both defined within the function. The output prompt of a is not defined, but the output of move is normal. Doesn’t it mean that variables within the function cannot be accessed outside the function? Why does move work? Ask for answers
move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68
move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68
Can you explain in detailIt can be done in IE browser Access the element directly using the element's id, which is equivalent to the attribute of the window object
. For example, in the IE browser, 123 can pop up
<div id="asd">123</div><script type="text/javascript">alert(asd.innerHTML);</script>
move is regarded as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68
move is regarded as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68
move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68