While Luca C.'s answer is specific on textarea element selection with :placeholder-shown
and jQuery, I want to answer the more specific question Is there a way that I can select a textarea such that $('#id_of_textarea').val() in jQuery will be ''?
combined with the following Is there an attribute for the text in a textarea?
While there is no attribute for the text in a textarea
to select, if you refer to Attribute Selectors you have no other choice but to first add your own data-* attribute to the textarea element...
...but if you instead refer to specifically style the placeholder div element and text, you can simply use the ::placeholder pseudo-element like this:
textarea::placeholder {
/* style properties */
}
thus these styling properties will apply only when the textarea has a placeholder text and has no "value" text