[フレーム]

JS Reference

JS by Category JS by Alphabet

JavaScript

JS Arrays JS Boolean JS Classes JS Dates JS Error JS Global JS Iterators JS JSON JS Maps JS Math JS Numbers JS Objects JS Operators JS Assignment JS Arithmetic JS Logical Operators JS Misc Operators JS Precedence JS Promises JS RegExp Patterns JS RegExp Reference JS Sets JS Statements JS Strings JS Typed Arrays JS Typed Reference

Window

Window Object Window Console Window History Window Location Window Navigator Window Screen

HTML DOM

HTML Documents HTML Elements
accessKey addEventListener() after() append() appendChild() attributes before() blur() childElementCount childNodes children classList className click() clientHeight clientLeft clientTop clientWidth cloneNode() closest() compareDocumentPosition() contains() contentEditable dir firstChild firstElementChild focus() getAttribute() getAttributeNode() getBoundingClientRect() getElementsByClassName() getElementsByTagName() hasAttribute() hasAttributes() hasChildNodes() id innerHTML innerText insertAdjacentElement() insertAdjacentHTML() insertAdjacentText() insertBefore() isContentEditable isDefaultNamespace() isEqualNode() isSameNode() isSupported() lang lastChild lastElementChild matches() namespaceURI nextSibling nextElementSibling nodeName nodeType nodeValue normalize() offsetHeight offsetWidth offsetLeft offsetParent offsetTop outerHTML outerText ownerDocument parentNode parentElement previousSibling previousElementSibling querySelector() querySelectorAll() remove() removeAttribute() removeAttributeNode() removeChild() removeEventListener() replaceChild() scrollHeight scrollIntoView() scrollLeft scrollTop scrollWidth setAttribute() setAttributeNode() style tabIndex tagName textContent title
HTML Attributes HTML Collection HTML NodeList HTML DOMTokenList HTML Styles
alignContent alignItems alignSelf animation animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationTimingFunction animationPlayState background backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPosition backgroundRepeat backgroundSize backfaceVisibility border borderBottom borderBottomColor borderBottomLeftRadius borderBottomRightRadius borderBottomStyle borderBottomWidth borderCollapse borderColor borderImage borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeft borderLeftColor borderLeftStyle borderLeftWidth borderRadius borderRight borderRightColor borderRightStyle borderRightWidth borderSpacing borderStyle borderTop borderTopColor borderTopLeftRadius borderTopRightRadius borderTopStyle borderTopWidth borderWidth bottom boxShadow boxSizing captionSide caretColor clear clip color columnCount columnFill columnGap columnRule columnRuleColor columnRuleStyle columnRuleWidth columns columnSpan columnWidth counterIncrement counterReset cssFloat cursor direction display emptyCells filter flex flexBasis flexDirection flexFlow flexGrow flexShrink flexWrap font fontFamily fontSize fontStyle fontVariant fontWeight fontSizeAdjust height isolation justifyContent left letterSpacing lineHeight listStyle listStyleImage listStylePosition listStyleType margin marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth objectFit objectPosition opacity order orphans outline outlineColor outlineOffset outlineStyle outlineWidth overflow overflowX overflowY padding paddingBottom paddingLeft paddingRight paddingTop pageBreakAfter pageBreakBefore pageBreakInside perspective perspectiveOrigin position quotes resize right scrollBehavior tableLayout tabSize textAlign textAlignLast textDecoration textDecorationColor textDecorationLine textDecorationStyle textIndent textOverflow textShadow textTransform top transform transformOrigin transformStyle transition transitionProperty transitionDuration transitionTimingFunction transitionDelay unicodeBidi userSelect verticalAlign visibility width wordBreak wordSpacing wordWrap widows zIndex

HTML Events

HTML Events HTML Event Objects HTML Event Properties HTML Event Methods

Web APIs

API Canvas API Console API Fetch API Fullscreen API Geolocation API History API MediaQueryList API Storage API Validation API Web

HTML Objects

<a> <abbr> <address> <area> <article> <aside> <audio> <b> <base> <bdo> <blockquote> <body> <br> <button> <canvas> <caption> <cite> <code> <col> <colgroup> <datalist> <dd> <del> <details> <dfn> <dialog> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <footer> <form> <head> <header> <h1> - <h6> <hr> <html> <i> <iframe> <img> <ins> <input> button <input> checkbox <input> color <input> date <input> datetime <input> datetime-local <input> email <input> file <input> hidden <input> image <input> month <input> number <input> password <input> radio <input> range <input> reset <input> search <input> submit <input> text <input> time <input> url <input> week <kbd> <label> <legend> <li> <link> <map> <mark> <menu> <menuitem> <meta> <meter> <nav> <object> <ol> <optgroup> <option> <output> <p> <param> <pre> <progress> <q> <s> <samp> <script> <section> <select> <small> <source> <span> <strong> <style> <sub> <summary> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <textarea> <time> <title> <track> <u> <ul> <var> <video>

Other References

CSSStyleDeclaration JS Conversion


JavaScript Operators Reference

JavaScript Operators

JavaScript Operators are used to assign values, compare values, perform arithmetic operations, and much more.

TypeCommon UseExample
Assignment Assigns values to variablesx = 5
Arithmetic Performs arithmetic between variablesx = y + 2
Logical Defines the logic between variables(x>0 || x>0)
Misc Miscellaneous operatorsvoid(0)

JavaScript Assignment Operators

Assignment operators assign values to JavaScript variables.

Oper Example Same As Result
= x = y x = y x = 5 Try it »
+= x += y x = x + y x = 15 Try it »
-= x -= y x = x - y x = 5 Try it »
*= x *= y x = x * y x = 50 Try it »
/= x /= y x = x / y x = 2 Try it »
%= x %= y x = x % y x = 0 Try it »
: x: 45 size.x = 45 x = 45 Try it »

Logical Assignment Operators

Oper Example Result
&&= true &&= 10 x = 10 Try it »
||= false ||= 10 x = 10 Try it »
??= null ??= 10 x = 10 Try it »

The Conditional (Ternary) Operator

The conditional operator assigns a value to a variable based on a condition.

Syntax Example
(condition) ? x : y (age < 18) ? false : true Try it »

The Spread (...) Operator

The ... operator splits iterables into individual elements.

Syntax Example
const myArr = [1, 2, 3]; let xMin = Math.min(...myArr); Try it »

JavaScript Arithmetic Operators

Arithmetic operators are used to perform arithmetic between variables and/or values.

Given that y = 5, the table below explains the arithmetic operators:

Oper Name Example Results Try it
+ Addition x = y + 2 y=5, x=7 Try it »
++ Increment x = y++ y=6, x=5 Try it »
++ Increment x = ++y y=6, x=6 Try it »
- Subtraction x = y - 2 y=5, x=3 Try it »
-- Decrement x = y-- y=4, x=5 Try it »
-- Decrement x = --y y=4, x=4 Try it »
* Multiplication x=y*2 y=5, x=10 Try it »
** Exponentiation x = y ** 2 y=5, x=25 Try it »
/ Division x = y / 2 y=5, x=2.5 Try it »
% Remainder x = y % 2 y=5, x=1 Try it »

Javascript Comparison Operators

Comparison operators are used in logical statements to determine equality or difference between variables or values.

Given that x = 5, the table below explains the comparison operators:

Oper Name Comparing Returns Try it
== equal to x == 8 false Try it »
== equal to x == 5 true Try it »
=== equal value and type x === "5" false Try it »
=== equal value and type x === 5 true Try it »
!= not equal x != 8 true Try it »
!== not equal value or type x !== "5" true Try it »
!== not equal value or type x !== 5 false Try it »
> greater than x > 8 false Try it »
< less than x < 8 true Try it »
>= greater or equal to x >= 8 false Try it »
<= less or equal to x <= 8 true Try it »

JavaScript Logical Operators

Logical operators are used to determine the logic between variables or values.

Given that x = 6 and y = 3, the table below explains the logical operators:

Oper Name Example Try it
&& AND (x < 10 && y > 1) is true Try it »
|| OR (x === 5 || y === 5) is false Try it »
! NOT !(x === y) is true Try it »

JavaScript Bitwise Operators

Bit operators work on 32 bits numbers. Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.

Oper Name Example Same as Result Dec Try it
& AND x = 5 & 1 0101 & 0001 0001 1 Try it »
| OR x = 5 | 1 0101 | 0001 0101 5 Try it »
~ NOT x = ~ 5 ~0101 1010 10 Try it »
^ XOR x = 5 ^ 1 0101 ^ 0001 0100 4 Try it »
<< Left shift x = 5 << 1 0101 << 1 1010 10 Try it »
>> Right shift x = 5 >> 1 0101 >> 1 0010 2 Try it »
>>> Unsigned right x = 5 >>> 1 0101 >>> 1 0010 2 Try it »

Track your progress - it's free!
×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

FORUM ABOUT ACADEMY
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.

AltStyle によって変換されたページ (->オリジナル) /