Can we use "value" attribute in "textarea" tag?

I have been told that does not support the value attribute, when i check on MDN. But chatGPT told me it supports:

The textarea element in HTML does support the value attribute

which one is right?

I think maybe chatGPT is talking about adding a value (or text) to the textarea versus adding a value —attribute— which is added to the textarea opening tag.

Also chatGPT is not an expert in anything. So I would never trust it over the official documentation for the language.

3 Likes

As @hbar1st says, chatGPT often gives incorrect or misleading responses. This is a perfect example as it fails to disambiguate between different meanings of the term value, for instance.
I would only ever use chatGPT with extreme caution, if at all!

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.