Is there any way, using CSS, to set the content of an after
pseudo-element to an attribute of a sibling form element?
For example:
p:after{
content: +select(attr(title));
}
<p>Message: </p>
<select>
<option title="Hi" value="1">Hi</option>
<option title="Hello" value="2" selected>Hello</option>
<option title="Goodbye" value="3">Goodbye</option>
</select>
The desired rendered output in this example would be: Message: Hello
If this is not currently possible, are there any plans in the CSS4 (or 5?) specification to allow the use of selectors in the content
property?
I have a jQuery solution, however I am curious if this is something I could do without javascript?