var idPost=document.getElementById("status").innerHTML;
The ‘status’ element does not exist in your webpage.
So document.getElementById(“status”) return null. While you can not use innerHTML property of NULL.
You should add a condition like this:
if(document.getElementById("status") != null){ var idPost=document.getElementById("status").innerHTML; }
Related Posts:
- Cannot set property ‘innerHTML’ of null
- How to replace innerHTML of a div using jQuery?
- React.js: Set innerHTML vs dangerouslySetInnerHTML
- Difference between innerText, innerHTML and value?
- Is it possible to append to innerHTML without destroying descendants’ event listeners?
- Discord error cannot read property ‘isFocused’
- Is there a “not in” operator in JavaScript for checking object properties?
- Sorting object property by values
- Javascript – Replace html using innerHTML
- “Uncaught TypeError: Illegal invocation” in Chrome
- Check if a string has a certain piece of text [duplicate]
- How to convert a string to an integer in JavaScript?
- How do I make the first letter of a string uppercase in JavaScript?
- window.location.href and window.open () methods in JavaScript
- How to create an associative array in JavaScript literal notation
- Include another HTML file in a HTML file
- Cannot open local file – Chrome: Not allowed to load local resource
- How to read a local text file?
- Compare dates with javascript
- Javascript Uncaught SyntaxError: Unexpected identifier
- “document.getElementByClass is not a function”
- How can I create a two dimensional array in JavaScript?
- React Native: this.setState is not a function
- How to perform string interpolation in TypeScript?
- forEach is not a function error with JavaScript array
- Short circuit Array.forEach like calling break
- Bootstrap Dropdown menu is not working
- String.prototype.replaceAll() not working
- What does the className attribute mean in JSX?
- How do I check for null values in JavaScript?
- How do I format date in jQuery datetimepicker?
- Express Render not working return error: No default engine was specified and no extension was provided
- Remove Object from Array using JavaScript
- Angular4 – No value accessor for form control
- What is the difference between ( for… in ) and ( for… of ) statements?
- TypeError: Cannot read property “0” from undefined
- How to use npm jquery module?
- Jquery swipe left or right on mobile
- How to check if two arrays are equal with JavaScript?
- What is causing the error `string.split is not a function`?
- Does JavaScript have a built in stringbuilder class?
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Pass react component as props
- How to fix Cannot find module ‘typescript’ in Angular 4?
- Origin null is not allowed by Access-Control-Allow-Origin
- using jQuery $(this).addClass not working, simple code not working
- onClick to get the ID of the clicked button
- HTML text input allow only numeric input
- How to change the buttons text using javascript
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- What is the difference between String.slice and String.substring?
- How to use in jQuery :not and hasClass() to get a specific element without a class
- Crop the image using JavaScript
- What is the best way to remove a table row with jQuery?
- Adjust width and height of iframe to fit with content in it
- document.getElementbyId() returning null
- Seeding the random number generator in Javascript
- Bootstrap popover is not working
- Sort array of objects by single key with date value
- How to embed a youtube playlist with a sidebar
- How to add a button dynamically using jquery
- External JavaScript Not Running, does not write to document
- Create a simple 10 second countdown
- Generate a Hash from string in Javascript
- jQuery if Element has an ID?
- Get name of object or class
- Complex JSON nesting of objects and arrays
- jQuery – Increase the value of a counter when a button is clicked
- Insert a string at a specific index
- What does `node –harmony` do?
- AngularJS POST Fails: Response for preflight has invalid HTTP status code 404
- Getting “Cannot call a class as a function” in my React Project
- Separating html and JavaScript in Flask [duplicate]
- How to read and write into file using JavaScript?
- wp.customize.bind ready event not fired
- What does wp-list.js do?
- Preventing YouTube embeds loading multiple instances of player JS?
- How to combine javascript files without plugins?
- WordPress Errors? Update Failed! data.min.js
- Use useSelect/useDispatch instead of withSelect/withDispatch
- Load script after block is inserted
- Trouble adding JavaScript in visual editor (Sharpspring embed code)
- How to set translations in javascripts for my plugin?
- How to make wordpress URLS google friendly for ajax driven sites?
- Google PageSpeed Enable Compression isn’t working?
- How can I add Javascript in the header of all post pages and only post pages
- wp_enqueue_script not loading my custom js file
- Gutenberg getBlockIndex in save() function
- Widgets and Post/Page edit/new blank, console errors only, no server errors
- Add captcha validation to my custom form for Frontend posting
- AddThis Sharing Bar Not Displaying on Custom Page Template – JS conflict?
- Add JavaScript-Library “Fitty” to WordPress
- Access checks with custom REST endpoints and backbone
- early enqueueing javascript file in page template, not in functions.php
- jQuery + more won’t load in header
- How to add additional JavaScript code [duplicate]
- JavaScript errors
- How to load JavaScript modules with script_loader_tag hook?
- How to securely set dynamic HTML content with JavaScript?
- Astra Mobile Cart Drawer is blank on home page