Trending March 2024 # A Quick Glance Of Javascript Mouseover # Suggested April 2024 # Top 10 Popular

You are reading the article A Quick Glance Of Javascript Mouseover updated in March 2024 on the website Achiashop.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested April 2024 A Quick Glance Of Javascript Mouseover

Introduction to JavaScript mouseover

Web development, programming languages, Software testing & others

Syntax

mouseover is an event in JavaScript which occurs very frequently and the syntax flow for it is as follows:

object.onmouseover = function() { User-Defined Script; }; How does mouseover event work in JavaScript?

mouseover and mouseout are two events which have completely two behavior but have two elements which have the almost the same feature and same behavior which creates a kind of confusion between both the mouseover and mouseout events. Mouseover event is an event that is a part of the mouse movement where a mouse pointer comes and hovers over an element and mouseout when it leaves the mouse movements. Once the mouse leaves its position it is the event where these events will have some property related to the target and the target element but the question lies in the fact that mouseover elements and the components for it are completely complementary to the mouseout property of the mouse movement.

Next comes event.relatedTarget from where the element from which the mouse came i.e. where the related target gets attached to the target element. A total reverse happens for the mouseout event whose elements are also related to the mouseover event. In mouseout event which is complementary to the mouseover event first comes into account with the event. target where the element gets interacted with the target once the movement in the mouse is released for the first time.

Then comes the event.relatedTarget, where any new pointer element left for the mouse, gets interacted with the target element i.e. where the target element meets the relatedTarget element. The related target as part of the mover over function has a unique feature where the relatedTarget can be null. If the relatedTarget is null, then it means that the mouse didn’t come from another element, but it came out from the window or else it means that it left the window from the interaction to be made. Even if we try to use the event.relatedTarget with tag name i.e. event.relatedTarget.tagname then it will again throw an error which should be always kept in mind. It should be kept in mind before the related target moves to the null value. It can be said that the mouseover and mouseout both are the events which are related to the mouse from and to via divisions and elements which are part of the mousemove event which gets triggered.

Examples to Implement JavaScript mouseover

Below are the examples mentioned:

This program demonstrates the mouseover event as part of the mouse movement which is mainly used for performing and handling the events with the mouse over on the header as represented in the output. 

function mouseOver() { document.getElementById(“demo4”).style.color = “blue”; }

Output:

Before:

After:

Example #2

Code:

function mouseOut() { document.getElementById(“demo5”).style.color = “green”; }

Output:

After:

Note: Hovering over the elements will provide an overview to the user in the beginning and the location for making changes with mousemove that simplifies the overall process.

Conclusion

mouseOver events in JavaScript are one of the most important components which is complementary to the mouseOut event and both are somehow related to the mouse movement. These events are very essential for the UI events enhancement and mouse-related activities as they help the initial programmers to get an overview of the events that need some changes.

Recommended Articles

This is a guide to JavaScript mouseover. Here we discuss an introduction to JavaScript mouseover, appropriate syntax, how does it works with examples. You can also go through our other related articles to learn more –

You're reading A Quick Glance Of Javascript Mouseover

A Quick Glance Of 4 Types Of Css Combinators

Introduction to CSS Combinators

CSS also includes other ways of targeting elements by using selectors known as combinators together. This article will explain these combinators and how to use them in CSS. CSS combinator is something that describes how selectors relate to each other. A CSS selector could have more than one single selector in it. We may provide a combinator between the simple selectors.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Combinators in CSS

There are four types of CSS combinators available and can be described as shown below with the examples:

General sibling selector

Adjacent sibling selector

Child selector

Descendant selector

1. General sibling selector

The general sibling selector selects elements of a given element, including their siblings at the same level. The available sibling selector works similarly to an adjacent sibling. Still, it will select all siblings that appear after the defined element-even if they are not adjacent to each other. The tilde operator (~) can specify the general sibling selector.

Syntax:

element_name ~ element_name { }

Example:

body{ text-align: center; background-color: #8FBC8F; } div ~ p { background-color: #FFD700; font-size: 20px; font-weight: bold; } EDUCBA (Corporate Bridge Consultancy Pvt Ltd) is a leading global provider of skill based education addressing the needs of 500,000+ members across 40+ Countries. EDUCBA (Corporate Bridge Consultancy Pvt Ltd) is a leading global provider of skill based education addressing the needs of 500,000+ members across 40+ Countries.

Output:

In the above example, we select the ‘p’ elements, which come after the div tag. There is one ‘p’ element before div tag and inside the div tag, which will not get selected. The ‘p’ elements after the div tag will get selected.

2. Adjacent sibling selector

This matches the second element whenever the element follows the first element immediately, while both are children of the same parent. This sibling selector identifies the adjacent element, or we can assume the element next to the tag you specify.  In simpler terms, we could conclude that the adjacent sibling selector is efficient, allowing an element to be identified whenever it is next to another.

The adjacent sibling selector can be specified with the plus operator (+).

Syntax:

element_name + element_name { }

Example:

body{ text-align: center; background-color: #8FBC8F; } p + p { background-color: #FFD700; font-size: 20px; font-weight: bold; } EDUCBA (Corporate Bridge Consultancy Pvt Ltd) is a leading global provider of skill based education addressing the needs of 500,000+ members across 40+ Countries.

In the above example, we select the ‘p’ element, which comes after the ‘p’ element. The ‘p’ element, which is inside the div tag, will not be affected. The last paragraph will come before the third paragraph is selected as the adjacent sibling selector, as this selector selects its immediate element.

3. Child selector

The child selector identifies the parent’s immediate descendant. This combinator only matches those elements in the document tree which are the immediate child. Compared to the descendant selector, it is more restrictive as it selects the second selector only when its parent is the first selector.

Syntax:

// CSS styles }

Example:

body{ text-align: center; background-color: #8FBC8F; } background-color: #FFD700; font-size: 20px; font-weight: bold; } EDUCBA (Corporate Bridge Consultancy Pvt Ltd) is a leading global provider of skill based education addressing the needs of 500,000+ members across 40+ Countries.

Output:

4. Descendant selector

The descendant selector determines all descending elements of a specified element. The term descendant implies nested in the DOM tree wherever it is. It may be a direct child or higher than five levels, but it is always considered a descendant. It utilizes space as the separator between both elements.

Syntax:

element_name  element_name { }

Example:

body{ text-align: center; background-color: #8FBC8F; } div p { background-color: #FFD700; font-size: 20px; font-weight: bold; }

Output:

In the above example, we have selected the first and second paragraphs, which are children of the div tag. The div tag specifies an ancestor. i.e. parent element and paragraphs under the div tag indicate descendants.

Conclusion

CSS Combinators describes the connection between the two selectors, while the selectors in CSS are often used to specify content for styling. Combinators integrate the selectors to use them as a valuable relation and content position in the document. Often using classes is not that effective in some cases, and instead, using these combinators would help you write lesser code and do much more in CSS. That’s why Understanding them is good.

Recommended Articles

This is a guide to CSS Combinators. Here we discuss the introduction to CSS combinators along with 4 types, appropriate syntax, and respective examples. You may also have a look at the following articles to learn more –

A Quick Glance Of Sql All With Query Examples

Introduction to SQL ALL

Hadoop, Data Science, Statistics & others

Syntax and Parameters

The basic syntax for using ALL operator with SELECT statement is as follows :

SELECT ALL column_name FROM table_name WHERE condition(s);

The basic syntax for using ALL operator in WHERE clause is as follows :

SELECT column_name1, column_name2 FROM table_name WHERE column_name comparison_operator ALL (SELECT column_name FROM table_name WHERE condition_expression ); Parameters

The parameters used in the above-mentioned syntaxes is as follows :

table_name: Name of the database table from which the said columns will be fetched.

column_name: column which has to be used as a part of WHERE condition for comparison.

(SELECT column_name FROM table_name WHERE condition_expression ): The values obtained from the result set of this subquery will be compared with the column_name.

The syntax for using ALL operator with a HAVING clause is similar to the WHERE clause. The only difference is HAVING is generally used with GROUP BY clauses.

Examples of SQL ALL

In order to illustrate the functionality of ALL operator in SQL, what could be better than trying a few examples on a dummy table. Ergo, let us create two database tables called “employee” and “departments” respectively.

We can use the following CREATE table statements to create these tables.

CREATE TABLE employee ( employee_id integer, employee_name character varying(255), department_id character varying(255), salary numeric, highest_qualification character varying(255) )

CREATE TABLE departments ( department_id character varying(255), department_name character varying(255), location character varying(255), manager_id integer )

We have successfully created both the tables, namely “employee” and “departments”. Now with the help of the given INSERT queries given below, let us insert a few records in both the tables to work with.

(i) INSERT statement for inserting records in the employee table.

INSERT INTO public.employee( employee_id, employee_name, department_id, salary, highest_qualification) VALUES (101,'Roy Bernard','D01',5000,'B.Sc'), (102,'Gina Messenger','D01',6200,'M.Sc'), (105,'Jim Perkins','D03',5000,'B.A'), (106,'Erica Silverman','D03',7000,'MBA'), (107,'Priyanka M','D01',5000,'B.Tech');

(ii) INSERT statement for inserting records in departments table.

INSERT INTO public.departments( department_id, department_name, location, manager_id) VALUES ('D01','Research','Singapore',102), ('D02','Human Resource','Santa Monica',104), ('D003','Sales','New York',106);

Now we are all set to try a few examples based on these tables.

Example #1 – ALL operator with SELECT statement

Show the list of all the employees depicting their employee_id and names.

Code:

SELECT ALL employee_id, employee_name FROM employee WHERE department_id = 'D003';

Output:

Example #2 – ALL operator with WHERE clause

Find the employee_ids and salaries of employees who earn less than or equal to all the employees in the ‘D003’ department.

SELECT employee_id, salary FROM employee WHERE salary <= ALL(SELECT salary FROM employee WHERE department_id = 'D003');

Output:

Example #3

Find the employee_id, salary, and highest qualification of employees who earn equal to all the managers in the company’s New York office.

SELECT employee_id, salary, highest_qualification FROM employee WHERE employee_id = ALL(SELECT manager_id FROM departments WHERE location = 'New York');

Output:

Example #4 – ALL operator with HAVING clause

Prepare a summary table consisting of total employees and average salaries grouped together by highest qualification, provided that salaries of these employees is more than the average salary of all the departments.

Code:

SELECT highest_qualification, count(employee_id) as "Total_employees", ROUND(AVG(salary),2) as "Average_salary" FROM employee GROUP BY highest_qualification FROM departments as d JOIN employee as e ON d.department_id = e.department_id );

Output:

Example #5 – ALL operator with the UPDATE statement

Suppose the company has decided to raise the salaries of employees who have been earning a minimum salary until now to $5100. Write an update query to perform this task.

Code:

UPDATE employee SET salary = 5100 WHERE salary <= ALL(SELECT MIN(salary) FROM employee );

Output:

The query returned successfully. Let us check using the following SELECT query if the desired changes have been made.

SELECT * FROM employee;

Output:

It can be observed from the image that the salaries of employees who have been earning $5000 have been updated to $5100.

ALL operator with the DELETE statement

DELETE FROM employee WHERE employee_id = ALL( SELECT manager_id FROM departments WHERE department_id = 'D01');

Output:

Use the following SELECT query to check if the desired rows have been deleted.

SELECT * FROM employee;

Output:

The query returned successfully and has deleted the details of department D01’s manager.

Conclusion

ALL is a comparison operator that returns TRUE if all the values in the result set obtained from a subquery meet the specified condition. The operator can be used along with a SELECT statement, WHERE, and HAVING clause.

Recommended Articles

We hope that this EDUCBA information on “SQL ALL” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

A Quick Glance On Cpanel Alternative

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Some claim, in reality, that cPanel targets at the most punitive smaller companies and developers, with their single-license plans starting at $15 a month, more than most users pay for its servers every month. The price policy of cPanel is now account-based, making it extremely costly particularly for resellers.

Different cPanel Alternatives

Given below are the different cPanel Alternatives:

1. Moss.sh 2. SpinupWP

SpinupWP is a cloud server control panel designed especially for WordPress. This is a downside, and many would not even see it as a consequence. But SpinupWP has been planned from the ground up to do so, if you intend to use your servers to host WordPress. Delicious Brains, a small WordPress developer company with a reputation in industry, developed the platform. As you would imagine, their support (Monday to Friday) its brilliant and WordPress knows inside. Your dashboard is very simple, with minimal setup to take care of WordPress self-hosting.

3. ServerPilot

We’ve got ServerPilot next up. ServerPilot is a hosted server management dashboard, comparable to RunCloud, Moss and SpinupWP, making it simple to handle servers –whether you are over 100 or one. It is specifically designed to accommodate PHP web applications and WordPress Web sides by people who want to use their servers. You have a U.S.-based support team committed to ensuring that, if you have concerns, you can begin without any problems. ServerPilot requires an Ubuntu 20.04 or 18.04 64-bit server, which is installed via SSH using a special server command (which is provided by that server).

We’ve got ServerPilot next up. ServerPilot is a hosted server management dashboard, comparable to RunCloud, SpinupWP, and Moss, making it simple to handle servers – whether you are over 100 or one. It is specifically designed to accommodate PHP web applications and WordPress Web sides by people who want to use their servers. You have a U.S.-based support team committed to ensuring that, if you have concerns, you can begin without any problems. ServerPilot requires an Ubuntu 18.04 or 20.04 64-bit server, which is installed via SSH using a special server command (which is provided by that server).

4. Interworx 5. DirectAdmin

DirectAdmin is much like cPanel, but builds to be quicker and needs less server resources. It comes with a variety of webmail plugins, protection supplements, custom graphic skins and more. Thanks to its popularity in addition, DirectAdmin provides all the basics you would need for the control of resource use, DNS clustering and automated updates. With cPanel and not a change fan, you could be very comfortable with this, as it also provides Installation and Softaculous integrations – the same service behind cPanel’s CMS installations.

6. Virtualmin

Virtualmin is built on top of Webmin is a popular system administration interface for Linux. Virtualmin provides a solidly built free usable open source version, but pay-per-view versions are also available. It has many customization options and services, easy to conquer the competition. Beginners are only allowed to use it if they want to learn more and develop their qualifications. Otherwise, a little overwhelming might be the user interface.

7. Ajenti

An extendable open-source control panel is available in Ajenti. It helps users to access a remote Linux box easily and safely via web endpoints, text editors, file managers and other tools. The Ajenti Administrative panel provides remote terminal control, user management and allows you to install firewalls, package installation, and resource use, among other features. There are many Ajenti plugins available, but their platform has been created with development partners in mind, so you can easily create more to improve its key functionality if you know Python and JavaScript.

Recommended Articles

This is a guide to cPanel Alternative. Here we discuss the introduction and the different cPanel alternatives respectively. You may also have a look at the following articles to learn more –

A Quick Glance On Pl/Sql Exception

Introduction to PL/SQL Exception

PL/SQL exceptions are the erroneous situation that occurred while executing the program written in PL/SQL. While we do different operations and manipulations in the program, there is a possibility the program may generate an error. In order to handle these situations, we can make the use of exception handling in PL/SQL. There is a provision to handle the exceptions that are generated in PL/SQL, which is called as exception handling. There are two types of the exceptions that can occur in PL/SQL.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

The syntax of the exception in PL/SQL is as follows:

DECLARE

Statements or variables and constants to be declared in the beginning.

BEGIN

Commands to be executed in a stored procedure or where you write your business logic in PL/SQL.

EXCEPTION

We have to handle the exceptions in case if they arise while executing the code of the business logic.

WHEN exception 1 THEN statements to handle the exception 1 WHEN exception 2 THEN statements to handle the exception 2 WHEN exception 3 THEN statements to handle the exception 3 ……. WHEN exception n THEN statements to handle the exception n WHEN others THEN statements to handle the exception when it does not belongs to any of the above mentioned exceptions. END;

Note that in the above syntax, we can handle as many exceptions as we can and list them in WHEN this THEN that format. The default handling of exceptions is done by using WHEN others THEN code to execute on the occurrence of an exception.

Types of Exception

The exceptions are broadly classified into two types which are as specified below:

System defined exceptions

User-defined exceptions

1. System Defined Exceptions

PL/SQL provides already in build pre-defined exceptions, which are the most often raised exceptions. Some of them include no data found exception, access into null exception, case not found exception, the duplicate value on index exception.

In fact, the below table will provide you with the list of most often occurring exceptions along with their descriptions.

Exception Description SQL Code Oracle Error

INVALID_CURSOR This type of exception occurs when the cursor is used incorrectly and the operations being performed are not allowed related to the cursor, such as trying to close a cursor which has not even being opened. -1001 01001

LOGIN_DENIED If we are trying to log in to the database using the wrong password or username, this exception is raised. -1017 01017

STORAGE_ERROR When the PL/ SQL runs out of memory while executing the program or performing some operations in the database, this exception is raised. -6500 06500

ZERO_DIVIDE When we are trying to make an attempt of dividing a particular value with a zero number, then this exception is generated. 1476 01476

SELF_IS_NULL This exception is generated when a member method is given the call, but the object type instance of it is not being initialized. -30625 30625

INVALID_NUMBER This type of exception occurs when we are trying to convert the string into the numerical format and due to the content of the string being not able to traverse in the number format due to the presence of some characters or special symbols in the string. -1722 01722

Example:

System-defined exceptions.

Let us consider one example where we have the table named customers_details having the following contents shown in the image below.

Code:

DECLARE cust_id customers_details.customer_id%type := 99; customers_name customers_details.f_name%type; customers_mailid customers_details.email_id%type; BEGIN SELECT f_name, email_id INTO customers_name, customers_mailid FROM customers_details WHERE id = cust_id; EXCEPTION WHEN no_data_found THEN dbms_output.put_line('Customer Not Found!'); WHEN others THEN dbms_output.put_line('Sorry there is some error!'); END;

Output:

The output of the above program is as shown below as the customer having the customer id as 99 does not exist in our customers_details table.

2. User-Defined Exceptions

We can create our own exceptions, define them in our program, and even try to handle them by using exception handling mechanisms. This necessity arises when our error situation cannot be handled by using the predefined exceptions available in PL/ SQL.

Syntax of doing the same is as shown.

DECLARE sampleException EXCEPTION;

Let us consider one example that will help us demonstrate how we can create and handle our own user-defined exceptions.

Code:

DECLARE customer_id customers_details.customer_id%type := &cc_id; cust_name customers_details.f_name%type; cust_email customers_details.address%type; -- user defined exception sample_Exception_invalid_id EXCEPTION; BEGIN IF customer_id <= 0 THEN RAISE sample_Exception_invalid_id; ELSE SELECT name, address INTO cust_name, cust_email FROM customers_details WHERE id = customer_id; END IF; EXCEPTION WHEN sample_Exception_invalid_id THEN dbms_output.put_line('Provided ID should have the value more than zero'); WHEN no_data_found THEN dbms_output.put_line('Customer not found!'); WHEN others THEN dbms_output.put_line('Sorry! Some error occurred'); END;

Output:

The output of the above program is as shown below because there are none of the records in the customers_details table whose customer id is 99. Hence the user-defined exception created by us got raised, and the message was displayed while handling the exception that “Provided ID should have the value more than zero”.

Conclusion

Exceptions occur when there is an erroneous situation arising in the PL/SQL program. PL/SQL comes with some readymade predefined system exceptions, including no data found, invalid number, divide by zero, etc. We can handle these exceptions in our program, and we can do the appropriate actions on such an exception. The other type of exceptions is the user-defined exceptions that can be created by us and can be raised in our program according to the program’s requirement. Both types of exceptions can be handled by using the exception handling mechanisms in our program.

Recommended Articles

We hope that this EDUCBA information on “PL/SQL Exception” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

How To Get The Value Of The Target Attribute Of A Link In Javascript?

In this tutorial, we will learn how to get the value of the target attribute of a link in JavaScript.

The target attribute specifies where to open the linked document or page.

By default, its value is set to ‘_self,’ which means the linked document should open in the same window or tab. It can also have values like ‘_blank,’ ‘_self,’ ‘_parent,’ ‘_top,’ and ‘frame_name’, where each value defines a different location to open the linked document.

Using the target property

To get the value of the target attribute of a link in JavaScript, use the target property. The target attribute is used to set where you want the linked document to open i.e. in the same window or new window or same frame, etc.

We can use the document.getElementById() method to get an HTML element. This method takes the id of an element as a parameter and returns an element object. From that object, we can get the target attribute value of that element by using the ‘target’ property.

Syntax document.getElementById('mylink').target

In the above syntax, ‘mylink’ is the link’s id (e.g. anchor tag) and by using document.getElementById() method and ‘target’ property, we get the target attribute value from that link.

Example 1

You can try to run the following code to get the value of the target attribute of a link −

var

myVal

=

document

.

getElementById

(

“anchorid”

)

.

target

;

document

.

write

(

“Value of target attribute: “

+

myVal

)

;

Example 2

In the below example, we have used document.getElementById() method and target property to get the value of the target attribute of two different links.

function

getLink

(

)

{

let

target1

=

document

.

getElementById

(

‘link1’

)

.

target

let

target2

=

document

.

getElementById

(

‘link2’

)

.

target

let

root

=

document

.

getElementById

(

‘root’

)

}

Using the getElementsByTagName() Method

In JavaScript, the document.getElementsByTagName() method can be used to get the value of the target attribute of a link or anchor tag. It takes a tag name in the parameter and returns an HTMLCollection, similar to a list or array. It contains all of the element objects of that tag name, and from each object, we can also get the value of the target attribute by using the property ‘target’.

Syntax let links = document.getElementsByTagName('a') for (let index=0; index<links.length; index++){ let target = links[index].target console.log(target) }

In the above syntax, document.getElementByTagName() method takes ‘a’ as an argument, so it returns all of the elements which are anchor tags in an HTMLCollection, and looping through it, we get the target attributes values from all links and console logging it.

Example 3

In the below example, we have used a document.getElementByTagName() method to get the value of the target attribute from a link.

Get the value

of

the target attribute

of

a link

in

JavaScript using

function

getLink

(

)

{

let

root

=

document

.

getElementById

(

‘root’

)

let

links

=

document

.

getElementsByTagName

(

‘a’

)

for

(

let

index

=

0

;

index

<

links

.

length

;

index

++

)

{

let

target

=

links

[

index

]

.

target root

.

innerHTML

+=

}

}

Using the querySelectorAll() Method

In JavaScript, the document.querySelectorAll() method can be used to get the value of the target attribute of a link or anchor tag.

Syntax

Following is the syntax to get all anchor tags that have target attribute −

document.querySelectorAll('a[target]')

In the above syntax, document.querySelectorAll() method takes ‘a[target]’ as an argument. Hence, it returns all of the elements, which is an anchor tag containing the target attribute in a NodeList and looping through it, we can get all the target attribute values.

Example

In the below example, we have used the document.querySelectorAll() method to get the value of the target attribute of a link.

Get the value

of

the target attribute

of

a link

in

JavaScript using

function

getLink

(

)

{

let

root

=

document

.

getElementById

(

‘root’

)

let

links

=

document

.

querySelectorAll

(

‘a[target]’

)

for

(

let

index

=

0

;

index

<

links

.

length

;

index

++

)

{

let

target

=

links

[

index

]

.

target root

.

innerHTML

+=

}

}

Update the detailed information about A Quick Glance Of Javascript Mouseover on the Achiashop.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!