Skip to content

Category: Questions

How to use javascript to insert tags in tables

I’m trying to find a way to insert html element tags into a table structure. There are often multiple tables in an html page so I dynamically create and insert an ID for each table which works fine. However, when I try to insert specific html elements into the different portions of the table I get nothi…

showing/hiding html elements with javascript

which option among the following is better or used as a standard way to show/hide the html elements changing element.style.display adding/removing a separate class called hide {display: none} any other standard way PS: this JavaScript hide/show element question uses the first option mentioned( changes the sty…

convert dateTime format in react js

i have this date : Mon Aug 23 2021 15:03:00 GMT+0430 (Iran Daylight Time) how to convert this format: 2021-10-10T00:00:00 Answer You can do it as follows: If you don’t prefer the native way of converting it you can use the library Moment.js. Your code would look as follows: If you don’t want to ke…

Cannot set property ‘srcObject’ of null in Vue.Js

I am using vue.js with element-ui library and I have this problem where I need to show this dialog component to be able to show the camera and the user’s audio but I have the following error in console TypeError: Cannot set property ‘srcObject’ of undefined” As you can see, first I am …

How to add a decimal to jQuery animated counter?

I have an animated jquery counter that’s working fine, but I want to change the end number to a decimal number. So at the moment it’s counting up to 54000, but I want it to give me 54,000. How do I do this? jsfiddle is here Answer Try to use Number.prototype.toLocaleString(). Replace $this.text(th…