Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

document.getElementById is not obtaining the value of input type=text [closed]

Asked by Ayushi Gupta Jul 15, 2021 1.1K views 1 answer
Share

About this question

In this stripped down VF page, I have 2 standard inputs. I'm trying to get the value of the "testme" input from JS, but the 2nd alert never shows.

Am I missing something? VisualForce:

 [removed] function SetLaunchD() { alert('ddate is...'); var ddate = document.getElementById('testme').val(); alert(ddate); } [removed]  test input <input type="text" id="testme"> random input box <input type="Text" id="d2" value="" size="10" onblur="SetLaunchD();">  

How do I fix document getElementById is not a function?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.