getElemntbyid returns undefined value |
08-28-2018, 04:45 AM
(This post was last modified: 08-28-2018, 04:54 AM by kaitenz. Edit Reason: added info ) (08-27-2018, 11:36 PM)Vitaly83 Wrote: Using of jQuery and other libs will not help if the element with this ID is not exists. Using jQuery, you can check whether the element exist. Code: if($('#texttwo_'+rowid).length) I always do that check when I'm using DataTables or some other JS plugins. I first check if that table exists, then if yes, I initialize DT to that table. It always works for me. Edit: By the way, the code above will only return 0 or 1 (true or false equivalents) so no need to do if($('#texttwo_'+rowid).length > 0) Correct me if I'm wrong. |
Messages In This Thread |
getElemntbyid returns undefined value - by kvanaraj - 08-27-2018, 01:49 AM
RE: getElemntbyid returns undefined value - by InsiteFX - 08-27-2018, 02:56 AM
RE: getElemntbyid returns undefined value - by kaitenz - 08-27-2018, 10:18 PM
RE: getElemntbyid returns undefined value - by kvanaraj - 08-27-2018, 10:52 PM
RE: getElemntbyid returns undefined value - by Vitaly83 - 08-27-2018, 11:36 PM
RE: getElemntbyid returns undefined value - by kvanaraj - 08-28-2018, 12:21 AM
RE: getElemntbyid returns undefined value - by Vitaly83 - 08-29-2018, 08:38 AM
RE: getElemntbyid returns undefined value - by kaitenz - 08-28-2018, 04:45 AM
RE: getElemntbyid returns undefined value - by kaitenz - 08-28-2018, 04:51 AM
RE: getElemntbyid returns undefined value - by Wouter60 - 08-29-2018, 10:59 AM
|