Im trying to hide some options when I select a different country. These options are the states of this country. But, when I select the country, it doesnt showing nothing in the subcategory. So, I try make differents values using numbers, coz I cant use the same values in my application. Someone can help me? A…
Tag: html
Does element.replaceChildren() function work with duplicate values, or what is stopping this from working
currently i am trying to replace an elements children with the same value in an array e.g: my code is this: currently the fill function works fine and as intended the mock element class also works fine Answer JavaScript objects are references. This means that there is only a single h.element in the memory of …
How can I use a variable from another JavaScript file?
I have two html pages, each with a js file. When I click on a button on page 1, it should change a variable param to true and redirect the user to page 2. In page 2 I have to check if param = true and then continue my script. page1.html script1.js page2.html script2.js I tried export/import param but I
Showing class property value on click
I need to display the this.name in the console when clicking the button element. I could replace inside clicked() and set console.log(myBtn.name) but I’d like this method to work with any object. Is there a way to do it? When I click I get an empty string. Thanks! Answer You was almost there The problem…
Adding dynamic date to a static webpage
I want my static webpage timezone needs to be relative to CST, so if client(CST) open this file it should show CST date and Myself(IST) if I open this also it should show only the CST, could anyone please help me on this HTML file- JS file- Answer You shouldn’t try to assemble a date string yourself. Bo…
How can data from a GET request be displayed in HTML?
When I click on my button, I expect the data from the endpoint to be returned. However, I get this error: This is my function: Answer You’re replacing the innerHTML in every iteration. Did you mean to append to it? You should also be using the properties from each element iteration. Trying to access the…
Jquery script not working after ajax call
I have a problem, This Jquery Script not working after I did an ajax call and replaced the old content, you can see in the scripts the “slideToggle()” Not working but other orders like add and remove class’s working well? how I can fix this? Answer
Flexbox scroll overflowing content in an dynamic sized parent
I have a simple menu and content div structure. The menu has no fixed size and can expand depending on its content. The content div underneath should take the available space and scroll its own content if overflowing. Unfortunately, flexbox now behaves in such a way that the content div, due to its flex:1 pro…
Adding array of value in javascript
I’m asking this question again and hope I get the answer this time, I have an array of number that adds and subtract on button click which works withonclick and a function created. I will like the sum up of the array 21998 and 11999 when this same button is click and will like to display the value in &l…
How can I fill in simple forms using bookmarklets? Trouble shooting my simple code
Good afternoon, To save time at work, I am trying to use js autofill scripts. Bookmarklets seems to be the best way of doing this but the simple code I have doesn’t seem to work. As a test page, I have been trying- http://gangstaname.com/names/gangsta#.Ymf-cujMJPa as it’s a simple site with just o…