Home >Web Front-end >HTML Tutorial >Questions about javascript variable operation_html/css_WEB-ITnose

Questions about javascript variable operation_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:54:301473browse

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


Reply to discussion (solution)

move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68

move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68

Can you explain in detail

It 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

Can you explain in detailI know this, but it seems that there is no specific explanation of the question I raised


move is regarded as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68

Can you explain in detail
Change the name of move and see the effect



move is treated as 5a6506ed558a1a51a969970077ed55b516b28748ea4df4d9c2150843fecfba68

Can you explain in detail
Change the name of move and see the effect Well, I understand!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn