The problem was the positioning of code, the javascript should be placed inside the DIV tag rather than above it. This makes the thing work.
Related Posts:
- JavaScript Loading Screen while page loads
- Getting click on item to open closest relevant element (popup) with jQuery
- Site images are fixed in front of my site content [closed]
- How do I link a JavaScript file to a HTML file?
- How can I scroll to an element using jQuery?
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- JavaScript runtime error: ‘$’ is undefined
- Set timeout for ajax (jQuery)
- Use images like checkboxes
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- Click button copy to clipboard
- How to make html table vertically scrollable
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Why is the jquery script not working?
- How to make a simple image upload using Javascript/HTML
- How to make Bootstrap carousel slider use mobile left/right swipe
- bootstrap 3 navbar collapse button not working
- Play/pause HTML 5 video using JQuery
- Refresh/reload the content in Div using jquery/ajax
- How to get height of div in px dimension
- jQueryUI dialog width
- How to display raw JSON data on a HTML page
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- Random background images CSS3
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Fully responsive HTML5 video
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- How to use aria-expanded=”true” to change a css property
- How to set “style=display:none;” using jQuery’s attr method?
- jQuery UI Datepicker not working
- Automatically decrease font size for long words
- Show post in slider
- Accordion scrolls page too low after clicking on the title [closed]
- Adding a Calculator to a WordPress Page
- How to keep HTML form field that is conditional hidden with javasript hidden after page reload?
- Is it OK combined wp-include js, jquery, css? [closed]
- Replacing WordPress Icons (menu,icons32, etc)?
- Add other class content with reference class value
- Overriding inline !important CSS with Javscript code snippet with media query
- Unable to use Datepicker in a table when inserting a row
- jQuery function not working in WordPress but works in jsfiddle
- WP Media Uploader modal conflicts with Bootstrap modal
- Possible jquery / library conflict in plugin usage
- change the icon of a custom post type in WordPress to use twitter boostrap
- Element works, but not on wordpress site [duplicate]
- can’t make jQuery work (change image on time interval) [closed]
- Automatically pausing html5 video as the ‘next’ button is pressed (javascript/ jquery)
- Check if checkbox is checked with jQuery
- How can I get the data-id attribute?
- How to read xml file contents in jQuery and display in html elements?
- Rotate image with javascript
- Full-screen iframe with a height of 100%
- Check if an element contains a class in JavaScript?
- Equivalent of jQuery .hide() to set visibility: hidden
- Display XML content in HTML page
- Why write script type=”text/javascript” when the mime type is set by the server?
- How to scroll an HTML page to a given anchor
- Creating Accordion Table with Bootstrap
- $(document).ready(function() is not working
- Ajax call does not activate callback function
- Nice scroll to wordpress
- jQuery Hoverintent plugin in TwentyEleven Menu [closed]
- How wp_enqueue_script works?
- Script won’t execute in the media manager
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- JSON output returns page source code [closed]
- How to insert html/css/javascript code to wordpress plugin
- Dealing with a library that depends on jQuery
- Override theme style with other CSS on a specific page
- start.js:45TypeError: Not enough arguments on Safari [closed]
- Help with a jQuery Carousel
- Adding a slide toggle on WordPress
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- Search input area autogrow – how?
- Get value of selected option in select field in a WordPress form
- Screen Options JavaScript Code
- Theme has superfish – how to add supersubs?
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- How to use wp_ajax_set_post_thumbnail?
- Form validation before submitting
- Lightbox scroll page down on iPhone
- JQuery toggle in Visual Composer
- Javascript function to switch out images
- Enqueue javascript that inserts custom php widget into jQuery-constructed div
- Retrieve customizer value using ajax or customizer api and print the value in theme
- Trying to customize wordpress drop down categories
- wp_register_script Question
- Drop Down Category Menu Not Working
- Making custom pages (with an example to explain the goal)
- controlling the showing and hiding of the website logo
- Individual Pages are loading halfway down
- Widget won’t work due to old JavaScript? Any ideas how to make it work? [closed]
- Contact Form 7 – Submit Form not working After Ajax Request [closed]