2013-01-24 87 views
0

我有這樣的代碼,我想在確認後顯示detailMess。那麼,我怎樣才能打電話裏面的div-id如何從href標記調用「div id」

<a href="" onclick="return confirm('1 time count if you click OK, Are you sure?');">Show contact details</a> 

     <div id="detailMess" style="display: none;"> 

      <% 
       string uID = "-1"; 
       var u = Membership.GetUser(); 
       if (u != null) { uID = u.ProviderUserKey.ToString(); } 
       string U1 = Convert.ToString(Model.Load.OwnerId) ?? ""; 
       bool isOwner = uID.Equals(U1, StringComparison.OrdinalIgnoreCase); 
      %> 
      <% if ((!LDC.Common.isShowLetGoContactInfor) || (User.IsInRole("Staff")) || (isOwner)) 
       { %> 
      <% 
       if (Model.User != null && Model.User.Profiles == null) { Model.User.Profiles = new LDC.Domain.Profile(); } 
       Html.RenderPartial("ContactInfo", Model); 
      %> 
      <% } 
       else 
       { %> 
      <% Html.RenderPartial("LetgoContactInfo"); %> 
      <%} %> 
     </div> 

有人幫我plz!

回答

0

試一下:

<a href="#" onclick="document.getElementById('detailMess').show()">click</a>

我認爲它會工作。

+0

我想在第一次加載客戶端必須點擊確認查看,如果是 - >負載DIV –

+0

Pandian的回答會做 – Koladz

0

喜試試下面的代碼它會幫助你...

<html> 
<head> 
<script type='text/javascript'> 

function check() 
{ 
    if(confirm("1 time count if you click OK, Are you sure?")) 
    document.getElementById("sam").style.display=""; 
    else 
    document.getElementById("sam").style.display="none"; 
} 

</script> 
</head> 
<body> 
    <a href="#" onclick='check()'>check</a> 
    <div class="Sam" id="sam">Hi You are here now</div> 
</body> 
</html> 
相關問題