Simple Web Development project using HTML, CSS and JS for beginners



Tittle : Guessing Game 

            It is a very basic project for the beginners using HTML, CSS and JavaScript

                           HTML  - Hypertext Markup Language 

                                CSS - Cascading Style Sheet

                                     JS  -  Java Script


ABSTRACT


    Guessing game is a project aims in developing a computerized system. This project is mainly developed for gaming purpose. to play this game the user have to enter a random number in the given specified number box of some range, The system selects a random number of its own and that should be matched with users guess, according to that until the number matches the user will get alert message saying that guessed number is too low or too high until user selects the right number.


I suggest you to use codepen because it is User friendly.  Here is the Link  πŸ‘‰codepen .




Steps to be followed:

    1.Open codepen (by clicking on the link given above or you can use any text editor like             sublime text, notepad++ etc..) .

   2.Copy and paste the code (given belowπŸ‘‡) in respective fields.

    3.Save the code and execute it.

#if you want to know how it executes watch the video.


HTML CODE:

!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>A Great Demo on CodePen</title>
</head>
<body>
  <h1>Guessing Game</h1>
  <p>The number is between 1 to 10</p>
  <input type="number" id="userinput">
  <button onclick="check()">check</button>
</body>
</html>









CSS Code:

body{
  background:purple;
  color:white;
  font-size:xx-large;
  text-align:center;
}
h1{
 color:black;
}
p{
  text-color:;
}
button{
  background:Green;
  color:red;
}
  input,button{
  font-size:x-large;
  width:200px;
    text-align:center;
}









JavaScript Code:

//generating random number
var guessnumber=Math.round(Math.random()*10)
console.log(guessnumber)
function check(){
 var userguess=document.getElementById("userinput").value
console.log(userguess)
if(userguess>guessnumber){
  alert("guess is too high")
}
  else if(userguess<guessnumber){
    alert("guess is too low")
  }
else
  {
    alert("WoW! You found it")
  }
}













<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1389870630580192"

     crossorigin="anonymous"></script>

Comments

  1. Good, it helped me in my sem project.thankyou πŸ˜€

    ReplyDelete
  2. It's very good,it is very helpful to so many people_ nice idea__all the bestπŸ˜‡πŸ˜‡

    ReplyDelete
  3. Really helpful! Could use this for gaining knowledge πŸ‘

    ReplyDelete
  4. It's really helpful!!...great work, good luck with your project!

    ReplyDelete
  5. Tyss..... For the vedio πŸ‘πŸ‘πŸ™Œ

    ReplyDelete
  6. Nice work!
    It's Really useful
    Explore your knowledge with your upcoming vedios
    All the best ����

    ReplyDelete
  7. wonderfulπŸ‘This is exactly what I was looking for
    Go ahead....all the best

    ReplyDelete
  8. It has a nice finishing......
    Keep going...
    All the best πŸ‘

    ReplyDelete
  9. Good work πŸ‘πŸ‘
    Good luck for upcoming video's ...
    All the best πŸ‘πŸ‘

    ReplyDelete
  10. Nice...Good work πŸ‘πŸ‘ All the best.Hope u do very big projects

    ReplyDelete
  11. Good work
    All the bestπŸ‘πŸ‘

    ReplyDelete
  12. Really helpful!! πŸ‘
    All the bestπŸ€πŸ‘

    ReplyDelete
  13. Woww nice project... really it will be helpful to us for projects.good start!!πŸ‘πŸ‘

    ReplyDelete
  14. Woww nice project... really it will be helpful to us for projects.good start!!πŸ‘πŸ‘

    ReplyDelete

Post a Comment

Popular posts from this blog

Task Management

Todo List

Prank on snake game using HTML,CSS AND JS.