Java脚本在Sharepoint Designer 2013中不起作用

时间:2016-04-12 09:52:49

标签: javascript sharepoint-2013 sharepoint-designer

我写了一堆代码来捕获按钮点击的数量:

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server" >    

<script type="text/javascript">
var clicks = 0;
function onClick() {
    clicks += 1;
    document.getElementById("clicks").innerHTML = clicks;
};
</script>
</asp:Content>


<button type="button" onClick="onClick()">Click me</button>
<p>Clicks: <a id="clicks">0</a></p>

但点击次数仍为0,每次点击后都不会递增。

0 个答案:

没有答案