function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Issue with getting element using ElementId

I am trying below code to get the element using elementId but alert message is showing null value. Can anyone please suggest why it is behaving like this :

<apex:page standardController="Account">
  <apex:form >
      <apex:inputField value="{!}" id="accName"/>
      <apex:commandButton value="Test" onclick="testFunction(); return false;"/>
  function testFunction(){
Best Answer chosen by sharma_ffdc
In this case your inputField is nested in a form tag.
Try giving an ID to the form tag as well and access your component like:

Hope this helps.

Satish Kumar