Skip to content

Tag: html

Get the click position of the mouse on a page with iframe

I have an HTML page and I want to get the position of the mouse. I do this : But I have an Iframe and when I click on it, I don’t get the position. Do you have an idea ? Thank you Answer Here I am using Host listener (mousemove) for getting mouse position in the document with JavaScript

random equations in javascript

I want my code to create simple equations. You can put in answers and it tells you if you are correct or not. When I run this simple code, input the right answer and click on check, it doesn’t show correct. why is this and how can I fix? Answer In your code, check() requires two arguments rand1 and rand…

Read more / less code but it doesn’t change properly

After doing some research I came to this code shown below. If you try the code yourself you notice the variable is used for every div with a button and text (the whole site). I tried several other codes but I like the slideDown/Up feature. If somebody knows how I can rearrange this code to make it work for ev…

Using fetch to read and write files

In my code i’ve a file called “orca.txt” it is just a number writen in this. it looks like: 2300 I use fetch to read this number, i get it with: fetch(‘orca.txt’) .then(response => response.text()) .then(textString => { contador=textString; }); It works very well, but then …

JS will not run past set style.zIndex

I am trying to set up button elements. There are 2 scripts to get each button type and either run a simple collapse menu, or run a complicated collapse where slides 1 div over another after shifting depths. Everything seems to work except the depth (zindex) switch, and when the depth switch is implemented it …

How can I delay something in JavaScript [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. The community is reviewing whether to reopen this question as of 1 year ago. Improve this question I wanted to set …

How to pass id of object from table to next component?

In the table(table) i have loaded objects from API. When i click on “osavotjad” link i am redirected to another component where i want to load data from selected object. How can i pass id of object what is on the same line with a clicked link. Answer There are many ways to do that. The easiest sol…