I'm in need of assistance with updating HTML code similar to the following:
<textarea name="message"></textarea>
Specifically, I want to make a modification so that it appears as follows:
<textarea maxlength="300" name="message"></textarea>
I'm searching for a way to achieve this using JavaScript. Despite attempting various solutions sourced from different places, none have proven successful thus far. If necessary, I am also open to utilizing CSS code.