Reputation: 20078
why i am unable to display the text in my dev box?
<script type="text/javascript">
$(document).ready(function()
{
$("facebookUserBox").innerHTML("you have not loggged in...")
});
var loggedIn = '<%=IsLoggedIn%>'
if (loggedIn)
{
$("facebookUserBox").innerHTML("Logged in text");
}
</script>
<body>
<form id="form1" runat="server">
<div id="facebookUserBox"></div>
<br />
<br />
User Id: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
Password: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</form>
</body>
</html>
PS: i am not sure my jquery alignment is messed up.
Upvotes: 0
Views: 219
Reputation: 2953
This is jQuery, not prototype
use $("#facebookUserBox")
instead of $("facebookUserBox")
Upvotes: 2
Reputation: 15545
You need to prefix your jQuery selector with #
to tell it you're selecting an element by ID.
$("#facebookUserBox")
Upvotes: 4
Reputation: 7042
#facebookUserBox
In PrototypeJS you would use that selector, jQuery uses CSS selectors for $() function
Upvotes: 1