Using jQuery to add HTML element doesn't work
Hello everyone:
I am trying to add a paragraph by using jQuery, but the paragraph won't display in the browser.
Please review my code and give me some feedback on why the paragraph didn't show. Thanks!
- <html>
-
- <head>
- <title>hello world</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" ></script>
- <script language="JavaScript" type="text/javascript">
- <!--
- $(document).ready(function(){
- if($('<p>this is a new paragraphy</p>').is(':visible'))
- {
- $('p').show();
- }
- });
- //-->
- </script>
- </head>
- <body>
-
- </body>
- </html>