DEV Community

Kaviya R
Kaviya R

Posted on

1

Functions in Java Script

getElementById():
It is one of the most common was to select a single element in HTML DOM.
getElementByClassName():
Its used to select the document that have the specified class name(s)
getElementByTagName():
It returns an HTML collection of all element in the document that have the specific tag name.
QuerySelector:
It returns the first element within the document that matches the specified css selector.
CreateElement:
Its a method of the document object that create a new element node with the specified tag name.
PraseInt:
It parses the string element element and returns the integer
praseFloat:
This function parses a string and returns a floating-point number.
bind():
Like to putting the sticky note on the function that remember this specific thing.
push():
Adds something to the end of the list.
Pop:
Removes last thing from the list.
Math():
It act like toolbox inside the math tools inside
Math.abs():
Makes a number positive
getRootNode():
Finds the very top of HTML tree on a webpage
getSolution():
Its is used to solve a specific problem
console.error():
prints error message to the console.
sort():
puts alist in order
shift():
Removes the first thing from a list(array)
unshift():
Adds something to the beginning of a list.
addEvenListener():
Listens for something to happen on a webpage and then does something
eval():
Runs code that is inside a string.
escape():
Encodes a string for safe travel on the internet
sum():
Adds number together
document.right():
writes something directly onto the webpage.
length:
It tells you how many things are in the list

Neon image

Build better on Postgres with AI-Assisted Development Practices

Compare top AI coding tools like Cursor and Windsurf with Neon's database integration. Generate synthetic data and manage databases with natural language.

Read more →

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay