0

I am using wordpress and I am trying to change the content of an input placeholder content using CSS. I was able to do it in the desktop version by doing this.

.st-location-new:before {
    content: 'Routes';
    visibility:visible;
}
<label class="st-location-new">Where are you going</label>

In the mobile version I can't get to change the placeholder text by applying the same method but without any success. I was able to change the color and size of the font but not the content.

<input type="text" name="location_name" class="form-control" readonly="" placeholder="Where are you going?" id="dropdown-mobile-destination" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" value="">
1
  • 2
    Chrome doesn't support it anymore. You need to use HTML or JS instead. Commented Jan 27, 2020 at 14:51

1 Answer 1

1

Try this JavaScript code and delete the label statement

document.getElementsByName('location_name')[0].placeholder='Routes';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.