Else statement not executed javascript

后端 未结 5 1612
执念已碎
执念已碎 2021-01-27 10:25

Hey Guys in the below code every time the if statement is executed no matter what the condition is.

function addRow(tableID) {

            var table = document.         


        
5条回答
  •  故里飘歌
    2021-01-27 10:53

    At first check the null condition, this is basic law if something is present then proceed further , as in your case if element is not present it will throw undefined and nothing will work. even replace = with == in hidden part

提交回复
热议问题