Title: Implementing javascript in wordpress page
Last modified: August 20, 2016

---

# Implementing javascript in wordpress page

 *  [yaghi83](https://wordpress.org/support/users/yaghi83/)
 * (@yaghi83)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/implementing-javascript-in-wordpress-page/)
 * I am trying to implement a javascript code, that I created using html, dreamweaver,
   in one of my wordpress pages. I am having difficulty in having wordpress engage
   the code.
 * Any suggestions or observations?
 * Here is the code:
 * //
    <html> <body>
 * <script type=”text/javascript”>
    function logMe(){ var myTextField = document.
   getElementById(‘myText’); var myPass = document.getElementById(‘myPass’); if(
   myTextField.value == “ifp” && myPass.value == “ifp001”) { alert(“Welcome IF Properties”)
   parent.location=’[http://invpropmgt.com/property-owners/existing-owners/if-properties/&#8217](http://invpropmgt.com/property-owners/existing-owners/if-properties/&#8217);}
   else if(myTextField.value == “fwreone” && myPass.value == “fwreone001”) { alert(“
   Welcome Fort Wayne Real Estate One”) parent.location=’[http://invpropmgt.com/property-owners/existing-owners/fort-wayne-real-estate-one/&#8217](http://invpropmgt.com/property-owners/existing-owners/fort-wayne-real-estate-one/&#8217);}
   else if(myTextField.value == “mgi” && myPass.value == “mgi001”) { alert(“Welcome
   Mosaic Gold Investments”) parent.location=’[http://invpropmgt.com/property-owners/existing-owners/mosaic-gold-investments/&#8217](http://invpropmgt.com/property-owners/existing-owners/mosaic-gold-investments/&#8217);}
   else if(myTextField.value == “rri” && myPass.value == “rri001”) { alert(“Welcome
   Right Relations Inc.”) parent.location=’[http://invpropmgt.com/property-owners/existing-owners/right-relations/&#8217](http://invpropmgt.com/property-owners/existing-owners/right-relations/&#8217);}
   else if(myTextField.value == “jrogers” && myPass.value == “jrogers001”) { alert(“
   Welcome janel Rogers”) parent.location=’[http://invpropmgt.com/property-owners/existing-owners/janel-rogers/&#8217](http://invpropmgt.com/property-owners/existing-owners/janel-rogers/&#8217);}
   else if(myTextField.value == “tstockamp” && myPass.value == “tstockamp001”) {
   alert(“Welcome Thomas Stockamp”) parent.location=’[http://invpropmgt.com/property-owners/existing-owners/thomas-stockamp/&#8217](http://invpropmgt.com/property-owners/existing-owners/thomas-stockamp/&#8217);}
 *  else
    alert(“You have entered an incorrect username or password” + ‘\n’ +”Please
   try again!”) } </script> <table width=”370″ border=”0″> <tr> <th scope=”col”>
   User Name</th> <th scope=”col” align=”right”><input type=’text’ id=’myText’ /
   ></th> </tr> <tr> <th scope=”row”>Password</th> <td align=”right” scope=”col”
   ><input type=’password’ id = ‘myPass’/></td> </tr> </table> <table width=”200″
   border=”0″> <tr> <th scope=”col”><input type=’button’ onClick=’logMe()’ value
   =’Log In’ /></th> </tr> </table> </body> </html> //

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Kampflebkuchen](https://wordpress.org/support/users/kampflebkuchen/)
 * (@kampflebkuchen)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/implementing-javascript-in-wordpress-page/#post-2441577)
 * You should always use <script> inside the <head></head> of your page like:
 *     ```
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml">
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       <title>Hi theret</title>
       <script type="text/javascript">
       </script>
       </head>
   
       <body>
       </body>
       </html>
       ```
   
 *  Thread Starter [yaghi83](https://wordpress.org/support/users/yaghi83/)
 * (@yaghi83)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/implementing-javascript-in-wordpress-page/#post-2441588)
 * Thank you Kampflebkuchen,
 * I was able to resolve the issue by removing code tags wordpress adds to the code
   script:
 * // <![CDATA[
    …. and // ]]>
 * between <script></script>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Implementing javascript in wordpress page’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [integrate](https://wordpress.org/support/topic-tag/integrate/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [page](https://wordpress.org/support/topic-tag/page/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [yaghi83](https://wordpress.org/support/users/yaghi83/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/implementing-javascript-in-wordpress-page/#post-2441588)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
