Page 158 - DCAP408_WEB_PROGRAMMING
P. 158

Web Programming




                    Notes                 </script>
                                          </body>
                                          </html>
                                   Output
                                          Big: Hello Upendra!

                                          Small: Hello Upendra!
                                          Bold: Hello Upendra!
                                          Italic: Hello Upendra!
                                          Blink: Hello Upendra! (does not work in IE, Chrome, or Safari)
                                          Fixed: Hello Upendra!
                                          Strike: Hello Upendra!
                                          Fontcolor: Hello Upendra!
                                          Fontsize: Hello Upendra!
                                          Subscript: Hello Upendra!

                                          Superscript: Hello Upendra!

                                          Example: How to use the replace() method to replace some characters with some other
                                   characters in a string.
                                          <html>
                                          <body>
                                          <script  type=”text/javascript”>
                                          var  str=”Visit  America!”;
                                          document.write(str.replace(“America”,”India”));
                                          </script>
                                          </body>
                                          </html>
                                   Output
                                   Visit India!


                                          Example: How to use the length property to find the length of a string.
                                          <html>
                                          <body>
                                          <script  type=”text/javascript”>
                                          var  txt  =  “welcome  to  Saraswati  Institute  of  Engineering  &
                                          Technology!”;
                                          document.write(txt.length);
                                          </script>
                                          </body>
                                          </html>
                                   Output
                                          59



          152                               LOVELY PROFESSIONAL UNIVERSITY
   153   154   155   156   157   158   159   160   161   162   163