You defined the name attribute on your input field and not the id.

So either change the attribute in the input field to this:

<input type="text" id="webAdress" />

Or adjust your JavaScript to this (MDN docu):

function myFunction() {
  var webAdress = document.getElementsByName('webAdress')[0];
  alert(webAdress);
}
Answer from Sirko on Stack Overflow
🌐
Apple Community
discussions.apple.com › thread › 251822790
Notification popped up saying “null” is u… - Apple Community
I just got off a facetime call when this appeared, and it was a notification with a settings icon. it said something like (null) has access to your cameras, microphone, files etc. and when I swiped to see where the notification would take me nothing happened, it just stayed on the home screen.
Discussions

html - JavaScript - Alert is null why? - Stack Overflow
Why the output is null and not the length(here's the code:) More on stackoverflow.com
🌐 stackoverflow.com
How to fix the null value for alert logic? - javascript
I am trying to make a logic that if user input, date, and time are not filled it gives the user an alert to have the mentioned sections above, but for some reason, even when I have those sections More on stackoverflow.com
🌐 stackoverflow.com
June 13, 2022
Receiving "call from null" from Android System - Google Pixel Community
Due to the latest device launch, we expect to receive higher contact volume than normal. To check if your question is already answered, go to the Pixel Phone Help Center More on support.google.com
🌐 support.google.com
December 26, 2024
`Alert.getInstance` returns `null`
I was under the impression that when including the classes for alerts on an element, an Alert was instantiated for handling JavaScript interactions. This does not seem to be the case. When using Al... More on github.com
🌐 github.com
5
April 15, 2021
🌐
GitHub
github.com › openssl › openssl › issues › 24300
`ERR_reason_error_string()` returns `NULL` for `no_application_protocol` alert · Issue #24300 · openssl/openssl
April 29, 2024 - Hello all, OpenSSL 3.0 doesn't correctly report a reason string when handling the no_application_protocol alert; instead, ERR_reason_error_string() returns NULL. ERR_print_errors() and friends ...
Author: openssl
Top answer
1 of 2
1

All values obtained from form elements are strings. Even if the element is empty, the value is still "", not null so checking for null isn't the right approach.

Instead test for the absence of any "truthy" value as seen below.

// variables object
const el = {
  form: document.querySelector(".form"),
  input: document.querySelector(".user-input"),
  list: document.querySelector(".list"),
  date: document.querySelector(".date"),
  time: document.querySelector(".time")
};

//local storage key
const storage_key = "tasks-storage-key";

//Create ID
const createId = () => `${Math.floor(Math.random() * 10000)}-${new Date().getTime()}`;

//variable of empty array that gets new task
let taskList = [];

// function that renders task list

//function that creates new tasks with date and time
const creatTask = (task) => {
  const id = createId();
  const taskNew = el.input.value;
  const taskDate = el.date.value;
  const taskTime = el.time.value;
  const tasks = document.createElement("div");
  tasks.innerHTML = `     
      <div class="task-content">
        <div class="list-of-task">
        <div class="task" data-id="${id}">
        <input type="checkbox" class="tick">
        <div class="new-task-created">${taskNew}</div>
        <label class="due-date">${taskDate}</label>
        <label class="due-time">${taskTime}</label>
    </div>
    <div class="atcion-buttons">
        <button class="edit" data-id="">Edit</button>
        <button class="delete" data-id="">Delete</button>
    </div>
</div>`;

  taskList.push(tasks);
  console.log(taskList);
  el.list.appendChild(tasks);
  return task
};

//event listner that listens for add button.
function addTask(taskNew, taskDate, taskTime) {
  if (!taskNew) {
    alert("Please add a new Task")
  }
  if (!taskDate) {
    alert("Please add a new Task with a due date");
  }
  if (!taskTime) {
    alert("Please add a new Task with a due time");
  }
  creatTask();
}
<div class="form">
  <input class="user-input" type="text">
  <input class="date" type="date">
  <input class="time" type="time">
  <button onclick="addTask()" class="add" id="add">+</button>
</div>
<div class="list"></div>
Run code snippetEdit code snippet Hide Results Copy to answer Expand

2 of 2
0

Thanks for the help.

I also found another way of doing it as well after doing further research.

// variables object

const el = {
  form: document.querySelector(".form"),
  input: document.querySelector(".user-input"),
  list: document.querySelector(".list"),
  date: document.querySelector(".date"),
  time: document.querySelector(".time")
};
//local storage key

const storage_key = "tasks-storage-key";

//Create ID

const createId = () => `${Math.floor(Math.random() * 10000)}-${new Date().getTime()}`;

//variable of empty array that gets new task
let taskList = [];

// function that renders task list

//function that creates new tasks with date and time
const creatTask = (task) => {
  const id = createId();

  const taskNew = el.input.value;
  const taskDate = el.date.value;
  const taskTime = el.time.value;

  if (taskNew.length == 0) {
    alert("Please add a new Task");
  }
  if (taskDate.length == 0) {
    alert("Please add a new Task with a due date");
  }
  if (taskTime.length == 0) {
    alert("Please add a new Task with a due time");
  }

  const tasks = document.createElement("div");

  tasks.innerHTML = `
      
      <div class="task-content">
        <div class="list-of-task">
        <div class="task" data-id="${id}">
        <input type="checkbox" class="tick">
        <div class="new-task-created">${taskNew}</div>
        <label class="due-date">${taskDate}</label>
        <label class="due-time">${taskTime}</label>
    </div>
    <div class="atcion-buttons">
        <button class="edit" data-id="">Edit</button>
        <button class="delete" data-id="">Delete</button>
    </div>
</div>`;

  taskList.push(tasks);
  console.log(taskList);
  el.list.appendChild(tasks);
  return task
};

//event listner that listens for add button.
function addTask() {
  creatTask();
}
<div class="form">
  <input class="user-input" type="text">
  <input class="date" type="date">
  <input class="time" type="time">
  <button onclick="addTask()" class="add" id="add">+</button>

</div>

<div class="list"></div>
Run code snippetEdit code snippet Hide Results Copy to answer Expand

🌐
Google Groups
groups.google.com › g › prometheus-users › c › 4sD0nyRcS-w
Null value in alerts
I'm having trouble setting up an alert that will send a notification when a value is different from 0 and the value is missing (i.e. null).
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › csharp › language-reference › compiler-messages › nullable-warnings
Nullable reference type warnings - C# reference | Microsoft Learn
July 20, 2026 - The compiler produces a warning because the message parameter is assigned null and the method returns true. The NotNullWhen attribute indicates that shouldn't happen. To address these warnings, update your code so it matches the expectations ...
Find elsewhere
🌐
Google Support
support.google.com › pixelphone › thread › 315319187 › receiving-call-from-null-from-android-system
Receiving "call from null" from Android System - Google Pixel Community
December 26, 2024 - Due to the latest device launch, we expect to receive higher contact volume than normal. To check if your question is already answered, go to the Pixel Phone Help Center
🌐
GitHub
github.com › twbs › bootstrap › issues › 33651
`Alert.getInstance` returns `null` · Issue #33651 · twbs/bootstrap
April 15, 2021 - I was under the impression that when including the classes for alerts on an element, an Alert was instantiated for handling JavaScript interactions. This does not seem to be the case. When using Alert.getInstance(alertNode), null is returned. If instead new Alert(alertNode) is used then there are no problems.
Author: twbs
🌐
Quora
quora.com › I-got-a-notification-on-Facebook-Messenger-saying-that-someone-by-my-exact-name-messaged-me-but-when-I-tapped-on-it-it-said-Null-What-is-going-on
I got a notification on Facebook Messenger saying that someone by my exact name messaged me, but when I tapped on it, it said 'Null'. What is going on? - Quora
Answer (1 of 5): The notification you received on Facebook Messenger may have been a spam message or a message from a fake account that was using your name. When you tapped on the message and it showed "Null", it could mean that the message was deleted or not valid. > It's always a good idea t...
🌐
Oracle Community
community.oracle.com › customerconnect › discussion › 652788 › null-token-value-in-alert-composer
"Null" token value in alert composer — Cloud Customer Connect
October 27, 2022 - We are experiencing a problem within the Alert Composer configuration. In particular, we note that when a field (token) is not valued in the system it is extracted with the value "null" in the notification.
🌐
Grafana
grafana.com › docs › grafana › latest › alerting › fundamentals › alert-rule-evaluation › nodata-and-error-states
No Data and Error states | Grafana documentation
When an alert instance enters the No Data state, Grafana, by default, triggers a new DatasourceNoData alert. You can control this behavior based on the desired outcome of your alert rule in Modify the No Data or Error state. In Configure no data and error handling, you can configure the behavior when the evaluation returns no data or all values are null:
🌐
Quora
quora.com › What-does-null-mean-in-messaging-I-sent-someone-a-DM-in-GroupMe-and-at-the-bottom-it-said-read-null-then-when-I-closed-the-app-and-opened-it-again-it-just-said-read-What-does-this-mean-Did-they-receive-the-message
What does ‘null’ mean in messaging? I sent someone a DM in GroupMe, and at the bottom, it said “read (null)” then when I closed the app a...
Answer (1 of 4): Null is a programming term like ‘this space intentionally left blank’ My guess is the program expects to find ‘timestamp’ data there to know when it was read. The first time it dutifully reported ‘null’ the second time around it may have be processed by other code ...
🌐
Stack Overflow
stackoverflow.com › questions › 61187241 › getting-null-value-for-the-objects-while-creating-alert
Getting null value for the objects while creating alert - Stack Overflow
I myself haven't had any issues with "-10m", but the less range from now (fx "now-1m") the bigger the risks for insecurities. Therefore try and change it to "now-1h" and see if there still isn't any data (don't mind if the alert isn't triggered, just check if there is data).
🌐
Google Support
support.google.com › messages › thread › 298479152 › null-problem
Null problem - Google Messages Community
RCS is now available for texting between Android and iPhones. Learn how to turn on RCS chats on your Android phone (link)
🌐
Built In
builtin.com › software-engineering-perspectives › javascript-null-check
How to Check for Null in JavaScript | Built In
Null represents an intentional absence of a value, indicating a variable has been declared but hasn’t been assigned a value yet.