2
我試過這樣如何在asp.net中單擊文本框時顯示div。使用jQuery
<script type="text/javascript">
$(document).ready(function() {
$('#divID').hide();
$('#txtInsertComments').Onfocus(function() {
$('#divID').show(); });
});
</script>
//Asp.net Design
<asp:TextBox ID="txtInsertComments" runat="server" Text="Demo"></asp:TextBox>
<div runat="server" id="divID">
This is Div
</div>
,但仍然沒有工作......請幫我...
非常感謝這個建議。我正在使用母版頁。我做了同樣的,但仍然沒有工作.. :(我可以看到在我的網頁上的div containt之前,單擊文本框 – 2012-07-19 10:44:45
@SonamMohite你怎麼能看到div,你是不是隱藏它在你的document.ready函數 – freebird 2012-07-19 10:47:17
@SonamMohite它對你有用嗎?請讓我知道。 – freebird 2012-07-19 12:27:11