Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Javascript

Javascript

Scheduled Pinned Locked Moved ASP.NET
javascripttutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ysunil_74
    wrote on last edited by
    #1

    I have a hide and show div . How to hide the div when i click any where on the browser.

    S I 2 Replies Last reply
    0
    • Y ysunil_74

      I have a hide and show div . How to hide the div when i click any where on the browser.

      S Offline
      S Offline
      Sarani Ravindran
      wrote on last edited by
      #2

      Use MouseOnClick event to hide the div. Hide the div as below: document.getElementById("div1").style.display="none" God is always with you.

      Y 1 Reply Last reply
      0
      • Y ysunil_74

        I have a hide and show div . How to hide the div when i click any where on the browser.

        I Offline
        I Offline
        InsDev
        wrote on last edited by
        #3

        document.getElementById(id).style.display="none" for hide ur div. document.getElementById(id).style.display="inline" for show ur div Devjit Das.

        1 Reply Last reply
        0
        • S Sarani Ravindran

          Use MouseOnClick event to hide the div. Hide the div as below: document.getElementById("div1").style.display="none" God is always with you.

          Y Offline
          Y Offline
          ysunil_74
          wrote on last edited by
          #4

          I know document.getElementById("div1").style.display="none" will hide when on particular mouse click but i want to hide the div when clicked on any where on the browser. wht is the event will be raised when clicked on any where on thw browser. how to add that event to hide function .

          S 1 Reply Last reply
          0
          • Y ysunil_74

            I know document.getElementById("div1").style.display="none" will hide when on particular mouse click but i want to hide the div when clicked on any where on the browser. wht is the event will be raised when clicked on any where on thw browser. how to add that event to hide function .

            S Offline
            S Offline
            Sarani Ravindran
            wrote on last edited by
            #5

            Call on onkeypress event in the body tag. < body onkeypress="Checkkeycode();" > function checkkeycode() { if( event.keycode==13 ) { return false; } else { return true; } } //Keycode value for enter key is 13. God is always with you.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups