0

Is there a way to focus the placeholder pseudo-element of an element with focus?

None of the code below seems to work.

input:focus > ::placeholder {
  /* code here */
}

input:focus > input::placeholder {
  /* code here */
}
oldboy
  • 5,729
  • 6
  • 38
  • 86

1 Answers1

1

I figured this out right before posting, but thought I'd post it anyways in case somebody else is looking for the answer.

input:focus::placeholder {
  /* code here */
}
oldboy
  • 5,729
  • 6
  • 38
  • 86