CodeRunBox
Compiler
Glossary
Example
Course
HTML
CSS
JavaScript
Python
Swift
TypeScript
SQL
React
What is JavaScript?-- operator-= operator++ operator+= operatorAccessing and setting contentArray concat() methodArray indexOf()Array lengthArray pop()Array shiftArraysBooleansBracesCallback functionCalling the functionClassClosureCode blockCommentConditionsConsoleConstructorCreating a p elementData typesDate getTime()DestructuringElseElse ifEnumEquals operatorError HandlingES6Event loopEventsExtendFetch APIFilterFor loopforEach()FunctionFunction bind()Function nameGreater thanHead elementHoistingIf statementincludes()Infinity propertyIteratorJSONLess thanLocal storageMapMethodsModuleNumbersObject.keys()Overriding methodsParametersPromisesRandomReduceRegular expressionsRemoving an elementReplaceScopeSession storageSortSpliceStringString concat()String indexOf()SubstringSwitch statementTemplate literalsTernary operatorTileType conversionWhile loop

Creating a p element in JavaScript

Create a specific element by coding its name surrounded by quotes. For example, code p in between the " to create a paragraph.

jsx
<body> <h2>New Messages</h2> <script src="script.js"> </script> </body>
jsx
const paragraph = document.createElement("p");