Linked Questions
51 questions linked to/from Uncaught ReferenceError: function is not defined with onclick
0
votes
2
answers
7k
views
Uncaught ReferenceError: function is not defined. HTMLButtonElement.onclick with webpack in rails6 [duplicate]
I have tried to find a solution but I can't do this in. So I need help.
I work with rails 6, with webpack
I have a part of main.JS code:
window.onload = function() {
some code
};
/**
* Restart ...
0
votes
1
answer
2k
views
Onclick function is not defined [duplicate]
I have this fairly simple function that I want to call with onclick="". No matter what I do, I get the error Function is not defined.
html:
<a href="#" onclick="shareURL(); return false;" data-...
Meek's user avatar
- 3,372
0
votes
1
answer
1k
views
Why does my immediately invoked function expression interfere with my onclick? [duplicate]
(function() {
var tasks = /* Some awesome content stored here */
var render = '';
for(var x = 0; x < questions.length; x+= 1) {
render += '<p onclick="changeText(' + x +')">question[i]...
user avatar
user3162865
0
votes
1
answer
945
views
button onclick with tampermonkey [duplicate]
I'm new to all of this and I have decided to make a little script and I'm also using tampermonkey but when I add the buttons using tampermonkey the onclick seems to not work and I was wondering if ...
0
votes
1
answer
54
views
javascript, why you can't add onClick in HTML string, before you add this HTML string to DOM? [duplicate]
I need something like that:
function myfunc(){
const checkbocClick = () => {
console.log("chceckbox click")
}
createElement = () => {
let isChecked = (Number(...
621
votes
18
answers
1.7m
views
jQuery.click() vs onClick
I have a huge jQuery application, and I'm using the below two methods for click events.
First method
HTML
<div id="myDiv">Some Content</div>
jQuery
$('#myDiv').click(function(){
//...
37
votes
17
answers
212k
views
JavaScript Function Not Defined Error (BUT IT IS DEFINED)
I have a JavaScript function which fires on blur. Strangely enough it worked fine the first time I ran it, and ever since then I've been getting an error that says JavaScript Function Not Defined - ...
28
votes
3
answers
177k
views
Javascript Uncaught Reference error Function is not defined
Check the Fiddle to see the failure occurring.
When I add Data (Even if I leave it empty) to the text box and try to click "Add" it doesn't do anything.
Opening the Chrome and Firefox ...
15
votes
4
answers
53k
views
How do I double-click on objects using javascript? Do I have to .click() twice?
I tried searching for this but the only results that come up are on double click, and never how to automatically double click on something. (trigger a double-click.)
I can click once, and have tried ...
user avatar
user3365609
1
vote
4
answers
25k
views
How to Search a word from a sentence in javascript
I have this html code here:
<p id = "str">How much wood could a wood chip chop</p>
<br>
<input type = "text" value = "" id = "txt1"/>
<button onclick = "myFunction()"> ...
9
votes
3
answers
4k
views
How to call javascript functions inside a <script type="module"> from HTML element events?
I have a simple HTML page, which is importing a JS module as follows:
.. snip
<button onclick="btnClick()">Go!</button>
<script type="module">
import { func1 } from './utils.js'
...
2
votes
2
answers
7k
views
change dropdown button text on dropdown items selection
I am trying to develop drop down box list in HTML and CSS. I am trying to toggle drop-down box list on clicking on it. When I select some item, it is not coming in drop-down button.
Below is my ...
6
votes
2
answers
18k
views
Javascript, HTML and onClick - Function is not defined
I'm trying to make an "Insert link" button to a Rich Text Editor in Javascript. Basically, what it'll do is adding the following code to its content:
<a href="linkGoesHere" onClick="someJSFunction(...
user avatar
user2330526
-2
votes
5
answers
5k
views
Reversing User-Input String
Been banging my head on this. I'm trying to take user-input via form and print out their sentence backwards. It's not working and I'm not sure exactly why.
I used some code from here for the reverse ...
0
votes
6
answers
3k
views
How to underline active div
I am trying to make a jQuery function for switching between two divs, but I don't know how to make an "active" link underlined. Like link with selected div.
Here is the code:
JS:
function toggleDiv(...