I have simple html page:
<html>
<head>
<title></title>
</head>
<body>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/redmond/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#OpenDialog").click(function () {
$("#dialog").dialog({modal: true, height: 590, width: 1005 });
});
});
</script>
<a id="#OpenDialog" href="#">Click here to open dialog</a>
<div id="dialog" title="Dialog Title">
<p>test</p>
</div>
</body>
</html>
I need to have popup content hidden and when click on the link open a dialog.
What I'm wrong with in my code?
Thanks!
id
of element is not supposed to have #
in it if you want to use jQuery selector
as you used in $("#OpenDialog").click(
Change
<a id="#OpenDialog" href="#">Click here to open dialog</a>
To
<a id="OpenDialog" href="#">Click here to open dialog</a>
change the id
of the link from #OpenDialog
to OpenDialog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With