Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: changing the value of a text box with .js Date: Mon, 6 Sep 2021 15:09:43 +0200 Lines: 27 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net URrBPmcvmS/wJcvvYP9TegQFRDf8w3q/wMKzgEUFJeFGA70F0/ Cancel-Lock: sha1:K+Iu73983gAH5CM+uQn/hx6XkHA= In-Reply-To: Xref: csiph.com comp.lang.javascript:40375 bill: > I know how to change the value of a span or div using: > onClick= document.getElementById("searchkey").value = "type min 3 > letters"; or
don't have a value. What are you talking about? > but that does not work for an input type=text element. > > What is the proper way to do that? Using "value" is totally fine: However - where exactly do you use "onClick" and did you define "searchkey" as *id* and not only as name? -- Arno Welzel https://arnowelzel.de