skip to Main Content

Html – Get conditional values in JavaScript

I have a JavaScript layer for my HTML which has its first 3 rows presented below: var TR_Accomodation = { 'Hacı Sabancı': { 'İl': 'ADANA', 'Dist': 100, 'Accomodation_Type': 'hotel', 'Count': 52 }, 'Ceyhan': { 'İl': 'ADANA', 'Dist': 100, 'Accomodation_Type': 'motel',…

VIEW QUESTION

Javascript – JS undefined and NULL checker not working

for(const id of this.extraRooms) { let doesRoomExist = document.getElementById('newRoomAddress' + newRoomId); //if(typeof(doesRoomExist) !== "null") if(typeof(doesRoomExist) !== "undefined") { const newRoomLabel = document.getElementById('newRoomAddress' + newRoomId).value { Probably a simple fix but if doesRoomExist is NULL it is still going inside the…

VIEW QUESTION
Back To Top
Search