How do get html attributes value in client script in my ui page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 03:49 AM
hey, I try to get the value of HTML attributes in client script on the UI page that I created...
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 08:49 PM
Hi,
You should setup an id attribute on your HTML tag and then access it using the following syntax.
var attr = document.getElementById("ID").getAttribute("name");
https://www.w3schools.com/jsref/met_element_getattribute.asp
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 09:33 PM
Hi,
please refer below syntax,
<input type="checkbox" name="Checkbox1" id="check_one" value="$[count++]" onclick="addChecked(this);"> </input>
var res = document.getElementById('check_one').name; // For getting name of that element in client script
var resvalue = document.getElementById('check_one').value; // For getting value of that element in client script
Please mark as correct or helpful.
Regards,
Meghnath