CREATING ARRAY IN JAVA-SCRIPT
PROTOTYPE
THINGS VISIBLE IN IMAGE :
- The image above show us a black background encoded with blue background !
- Text inside the blue good with heading on top !
- After some space there are 4 keywords written each on separate line !
PERFORMING SUCH TASK THROUGH JAVA-SCRIPT
STEP BY STEP PROCESS FOR CODE :
- Open up your compiler, save it as .html extension !
- open necessary tags of html, head, title, body !
- In head tag provide a heading as I provided !
- Now create a div with class or id of whatever name you want !
- I coded in-line css here , the code for colors on page is below !
<!DOCTYPE html>
<body style=background-color:black;color:white;>
<html>
<head>
<title>LEARNING ARRAY IN JAVA</title>
</head>
<body>
<div style=background-color:skyblue;width:800px;height:150px;>
<h1>USING ARRAY IN JAVA BY DIV</h1>
<div id="your div name">
</div>
</div>
STEP TO PERFORM AFTER OPENING "DEMO"
- Open script tags !
- Declare variable I and text
- Initialize your Array with Any Name in var too !
- Open a loop , for ( run it from 0 to arraylength )
- put text = text + Array length[i] with +(sign) and <br> code
- close loop range and use the print command from array.
- In java = document.getElementById("your div name")
- use .innerHTML = text to save and display tag
- for ex : document.getElementById("yourdivname").innerHTML = text;
- close script tags ! the body and html tags !
CODE OF WHAT WE LEARN ABOVE !
--------------------------------------------------
<!doctype html> | |
<body style=background-color:black;color:white;> | |
<html> | |
<head> | |
<title>HTML JAVASCRIPT BASIC</title> | |
</head> | |
<body> | |
<center> | |
<div style=background-color:skyblue;width:800px;height:150px;> | |
<h1><b>USING DIV ON JAVASCRIPT</b></h1> | |
<div id="demo"> | |
<script type="text/javascript"> | |
var i; | |
var text=""; | |
var DummyArray=["IICT","PF","PIS","VLM"]; | |
for(i=-0; i<DummyArray.length; i++) | |
{ | |
text= text + DummyArray[i] + "<br>"; | |
} | |
document.getElementById("demo").innerHTML = text; | |
</script> | |
</div> | |
</div> | |
</center> | |
</body> | |
</html> |
--------------------------------------------------
TEACHINGS BY TRUESIGHT
2 Comments
Interesting. This looks super cool. I haven't read it all yet, but I'll be back to read the rest of it.
ReplyDeleteMedia Onlines
Your composing is purely awe-inspiring that I desired to read such high quality material...
ReplyDeleteSex Toys For Men