How to use the mouseup event in javascript18 Mar 2025 | 5 min read The mouseup event works with the mouse movement on the web page using the javascript functionality. The mouse-up event works on the laptop's mouse, or a single mouse click using the mouseEvent event. If we release the press button on the laptop, then the mouse-up event starts its handling functionality. If the mouse event function (mouseup) uses clicked mouse button after releasing the press button. It is similar to the mouse down function but has to click completely. SyntaxThe following syntax shows the mouse or mouse button release and go upside event using the "onmouseup" function. function using the addEventListener event. The following syntax uses a mouseup event with a javascript function. Support browsersThe mouse event function supports many browsers. The "mouseup" function supports the following browsers.
ExamplesThe mouseup events work with different methods and different events. We can use it to apply any functionality with mouse movement. Example 1: the basic mouseup event with the html tag and javascript function. Here we can use the mouseup function on the div tag. Its function uses in the javascript tag with the style tag to change height, colour and others. Output The following output shows the changes in html after working the mouseup function. ![]() Example 2: the basic mouseup event with the javascript function and handler. We can use the object of the html element id and use the function in the javascript. Output The following output shows the changes in html after working the mouseup function. ![]() Example 3: the mouseup event uses for windows with the javascript function and its handler. We can use the window object with the mouseup event with the handler name. Output The following output shows the changes in html after working the mouseup function. ![]() Example 4: the basic mouseup event with the javascript function and its handler. We can use the object of the html element id and use the function in the javascript. The mouse-down event uses the addEventListener event in the script tag. Output The following output shows the changes in html after working the mouseup function. ![]() Example 5: the example uses the mouseup event with the javascript function and its handler. We can use the object of the html body tag using id. The mouse-down event uses the addEventListener event in the script tag. Output The following output shows the changes in html after working the mouseup function. ![]() Next TopicThe "mousemove" Event in JavaScript |
Introduction: JavaScript is a widely used programming language, and it provides several built-in methods to manipulate strings. Two of the most commonly used methods for searching a string for a specific character or substring are indexOf() and search(). Although these two methods might appear similar in...
3 min read
JavaScript provides in-built functions to check whether the array is empty or not. Following are the method offered by JavaScript programming to check an empty array: length isArray(array) The Array.isArray() function checks the array type (passed parameter is an array or not) and array.length find the length of...
6 min read
We often come across charts on analytics-based sites or some websites that contain surveys on some common agendas like population, percentage, and whatnot. These charts are often used in the Data Interpretation field to create network shares or profit distribution in core sectors. However, if we...
11 min read
displays the y-coordinates or height of the given element. The read-only MouseEvent offsetY attribute returns the y-coordinate of the mouse cursor for the target element. We can add the event function on the div tag, web page, or other elements to display y-coordination. Syntax The following...
3 min read
Nowadays, almost all web-developers use JavaScript in their web-pages. JavaScript is a client-side scripting language that runs on a client machine (such as a web-browser). It helps web-developers to create modern web-pages that allow users to interact directly with the web-pages, without reloading them. If...
5 min read
? JavaScript is a light-weight object-oriented programming language that is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language. JavaScript enables dynamic interactivity on websites when it is applied to an HTML document. JavaScript helps the users to build modern web...
3 min read
Javascript logical assignment operators help to use the logical operators with the default and another expression. It works between two expressions or values with a single operator. ES2021 provides three logical assignment operators, which are as follows: Logical AND assignment operator Logical OR assignment operator Nullish coalescing assignment...
5 min read
The javascript prepend() method adds a set of array node objects or DOMString objects before the first child of an html parent node. There are two ways to use the javascript prepend method with the parent node. Using the prepend() method to prepend node Using the prepend()...
4 min read
The unique feature of async generator functions in javascript is their support to both await and yield. It returns an async iterator rather than a promise or iterator. The async generator functions are distinct from async functions and the generator functions in javascript. The () function...
3 min read
The JavaScript Console is provided easy methods with a quick and effective way to run JavaScript code just inside the browser. It is frequently used for many different things, such as logging some code's output or debugging code via the Console. In addition to the...
9 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India