Ask coding questions

← Back to all posts
My Javascript isn't doing what I'm telling it to
Japoll246 (15)

I am really new to Javascript and basically I made this href a button because the styling wasn't working on an <a> tag. When I click the button it opens a page that shows code I have since replaced and I am not quite sure why. Can anyone help?

Answered by Coder100 (16850) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (16850)

lol that's not how you use buttons

Japoll246 (15)

@Coder100 I just made it an <a href=""></a>. Thanks. I was now wondering, do you know of a way to make the css styling change when it's clicked? Right now in CSS it says to change the text-input border color when I hover over it. Is there anyway to have that border color stay when I click on and then move my mouse to type something?

Coder100 (16850)

@Japoll246 yeah, it would be the :focus

Coder100 (16850)
input:focus {
  border: 1px solid red;
}

change that to however you want ^^
@Japoll246