I am working on company website that is using placeholder attributes
I need to retrieve the color styling of this ATTRIBUTE ONLY, not from the input element itself.
It is being styled using --webkit-input-placeholder:
::-webkit-input-placeholder {
color: red;
}
Unfortunately when I try to retrieve the value using javascript:
var color = window.getComputedStyle(document.querySelector('[class=abc]'),
'::-webkit-input-placeholder').getPropertyValue('color');
I get the wrong color result:
rgb (0, 0, 0)
Which should be:
rgb (255, 0, 0)
Here is a fiddle with an example : https://jsfiddle.net/darnold24/6q1pr5cf/
Any help I can get would be very much appreciated :) I also have access to jQuery, but my understanding is that it could only retrieve properties of elements, not attributes.