www.webdeveloper.com
Results 1 to 2 of 2

Thread: need javascript help [1]

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    2

    need javascript help [1]

    Code:
    <input placeholder="Password.." onfocus="y()" type="text"/>
    
    
    function y(){
    this.style.backgroundColor="red";
    }

    whys this not working, can someone help?

  2. #2
    Join Date
    Oct 2013
    Posts
    457
    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    
    	<meta charset="utf-8">
    
    	<script>
    		function y(el){
    			el.style.backgroundColor="red";
    		}
    	</script>
    
    	<title>untitled document</title>
    
    </head>
    
    <body>
    
    	<form action=""><input placeholder="Password.." onfocus="y(this)" type="text"/></form>
    
    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles