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
Bhargav SurapaneniBhargav Surapaneni 

Javacript document.id alert function not working

Hi
I had a code where I need to compare mobile number & display that alert and highlight the specific row. here is my code

if(existingMobileSet.has(Number(mobileNumber)) == true){
               document.getElementById(mobNumber).style.borderColor = "red";
              document.getElementById(mobNumber).focus();
              document.getElementById(mobNumber).select();
              alert('Member already added to this  Activity');}

Alert was displaying properly but even after clicking ok there is no response still popup is not going. Please help me how to resolve this.
Thanks in Advance
devedeve
Hi Bhargav,
You must provide id in quotes in document.getElementById. .For example,

document.getElementById('mobNumber').style.borderColor = "red";

Thanks