Here you go:
div{ display: none; } document.querySelector("button").addEventListener("click", function(){ document.querySelector("div").style.display = "block"; }); <div>blah blah blah</div> <button>Show</button>
LIVE DEMO: http://jsfiddle.net/DerekL/p78Qq/
Related Posts:
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How can I scroll to an element using jQuery?
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- Set timeout for ajax (jQuery)
- How does the data-toggle attribute work? (What’s its API?)
- CSS height 100% percent not working
- Use images like checkboxes
- Completely disable scrolling of webpage
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Full-screen iframe with a height of 100%
- How to print HTML content on click of a button, but not the page?
- Bootstrap 4 Dropdown Menu not working?
- Why is the jquery script not working?
- Textarea Auto height
- Why is marquee deprecated and what is the best alternative?
- Refresh/reload the content in Div using jquery/ajax
- How to write inside a DIV box with javascript
- How to get height of div in px dimension
- Crop the image using JavaScript
- Force div to be topmost element of any and all webpages
- Retrieve the position (X,Y) of an HTML element
- How to display raw JSON data on a HTML page
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Change an image with onclick()
- JavaScript – Count Number of Visitor for Website
- Creating Accordion Table with Bootstrap
- Fully responsive HTML5 video
- How to create checkbox inside dropdown?
- Positioning element at center of screen
- Adding Google Translate to a web site
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- How to use aria-expanded=”true” to change a css property
- How to set “style=display:none;” using jQuery’s attr method?
- WordPress Bootstrap Handburger Menu Wont Open
- Hide CSS class only in single post pages
- Angular: conditional class with *ngClass
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- How to make a word underline in Markdown
- How to play audio?
- How to play audio?
- Include another HTML file in a HTML file
- How to add jQuery code into HTML Page
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- jquery SlideToggle effect in upward direction?
- HTML5 Local storage vs. Session storage
- Express Render not working return error: No default engine was specified and no extension was provided
- Jquery swipe left or right on mobile
- How to move an element into another element?
- How to move all HTML element children to another parent using JavaScript?
- TypeError: $(…).modal is not a function with bootstrap Modal
- document.getElementsByClassName().innerHTML always returns “undefined”
- How to do fade-in and fade-out with JavaScript and CSS
- Vue is not defined
- Error: ENOENT: no such file or directory, stat ‘/public/main.html’ at Error (native)
- onClick to get the ID of the clicked button
- HTML text input allow only numeric input
- How to change the buttons text using javascript
- How do I use this JavaScript variable in HTML?
- How to close current tab in a browser window?
- How to pass parameters using ui-sref in ui-router to controller
- What does ngf-select do and why is it needed for form validation?
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- Creating a div element in jQuery
- How to use in jQuery :not and hasClass() to get a specific element without a class
- Adjust width and height of iframe to fit with content in it
- Get class list for element with jQuery
- How to make an HTML back link?
- How to fix getImageData() error The canvas has been tainted by cross-origin data?
- HTML/Javascript change div content
- How To Save Canvas As An Image With canvas.toDataURL()?
- How to embed a youtube playlist with a sidebar
- External JavaScript Not Running, does not write to document
- JavaScript button onclick not working
- Create a simple 10 second countdown
- Get the size of the screen, current web page and browser window
- How to enable a disabled checkbox dynamically?
- When is a CDATA section necessary within a script tag?
- How to change cursor from pointer to finger using jQuery?
- How can I remove a style added with .css() function?
- How to wrap the content of the main tinyMCE editor with extra tags
- Minify HTML, CSS, JS with PHPWee?
- How do developers add “Smooth Transitions” to their sites?
- Building a slide down search box in wordpress
- How can I get the search form to be selected automatically?
- WP adds long version query strings to CSS and JS files
- creating a static HTML/JS/PHP page
- Web cover page open when button clicked
- How to run Javascript popup modal in a loop?
- Landing Page with HTML CSS JS and Images on wordpress
- Where to find the html for WordPress site? [closed]
- How to keep close a sub-menu under homepage? [closed]
- Interactive maps in wordpress