将空值更改为从提示创建的表中的用户定义值 [英] Changing null value into user defined value in the table created from prompt

查看:53
本文介绍了将空值更改为从提示创建的表中的用户定义值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我创建了一个将输入发送到表中的提示但是如果我输入null我怎么能在特定单元格中写未提供的数据

我尝试使用.defaultValue和Innerhtml但是所有这些都是从表格输入而不是提示



我尝试了什么:

< br $>
.defaultValue

.innetHTML



所有教程都指向不形成提示

解决方案

你应该检查变量是否为 null undefined



前两个答案都是正确的:

Stack OverFlow:javascript - 如何确定变量是'undefined'还是'null'? [ ^ ]

Hey guys, i created a prompt to send input into the table but if i input null how can i write "data not supplied" in the particular cell
I tried using .defaultValue and Innerhtml but all of them were directed to the input from form rather than prompt

What I have tried:

.defaultValue
.innetHTML

all of the tutorials were directed to form not the prompt

解决方案

You should check the variable against being both null and undefined.

Both of the first two answers are correct:
Stack OverFlow : javascript - How to determine if variable is 'undefined' or 'null'?[^]


这篇关于将空值更改为从提示创建的表中的用户定义值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆