我是初学者.我正在尝试弹出一个带有文本内容的警报框<div>,但是我正在获取null.
使用Javascript:
alert(document.getElementById("ticker").value);
Run Code Online (Sandbox Code Playgroud)
HTML
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script src="Tick.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="ticker">
Sample
</div>
</asp:Content >
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
javascript ×1