Focus


#1

https://www.codecademy.com/en/courses/web-beginner-en-JwhI1/1/3?curriculum_id=50a3fad8c7a770b5fd0007a1


Hi all, I understand how to make the code word but I am wondering: why doesnt this code below work? (this is how we were taught to adress name attributes in unit 3 exercise 12 https://www.codecademy.com/en/courses/web-beginner-en-v6phg/2/3?curriculum_id=50a3fad8c7a770b5fd0007a1 )


$(document).ready(function(){
    $("input['name=text']").focus(function(){
      $(this).css("outline-color","#FF0000");  
      })
    ;})


#2

^ If you want to do it that method it would be like this:

$("input[name=text]").focus();

This one line sets that any input text will be on focus when clicked and by default it is blue .. Read more


In this lesson Codecademy is teaching you how to add a css style (adding outline-color red[#FF0000] when in focus)

Here you will need to read the lesson and follow the instructions and learn this particular way, if you still get an error after following the instructions then paste in your code and I will help you.

Thanks


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.