all thing you have to do is use javaScript function
JavaScript Example:
var random_number = function(){
return Math.floor(Math.random() * 10000) + 1;
};
document.getElementById('button_text').onclick = function () {
document.getElementById("input_box").innerHTML = random_number();
};
jQuery Example:
$.randomBetween(0,10000);
Related Posts:
- Getting only direct child pages in WordPress with get_pages
- Disable Attachment Pages Completely
- How to add a .php file to WordPress
- How to Remove all Instances of edit_post_link
- How to check if feed URL was requested?
- Create WordPress pages with PHP
- Is it possible to generate a page without create in the admin?
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- WordPress admin never finishes saving page on site with large page count
- class=”parent” for wp_list_pages?
- PHP Script within wordpress theme
- Listing all sub-pages?
- Get only the grandchildren, not the direct children of page/current page?
- Help with a custom page template – listing contents of childpages?
- Print number of post (in reverse)
- How can the plugin directory path be returned into ?
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Loading jQuery in the footer after removing jQuery migrate?
- Writing scripts using WordPress / WooCommerce classes?
- Limit get_pages to only show 5 items
- syntax issue on php 7.4
- How do I publish only one page to production after making changes on staging?
- Custom Template 404 for specific custom post type
- Can’t load WP function into external function
- Displaying a button on each post
- Custom category code not showing all posts
- Using Multiple Submit buttons to trigger customised php functions
- Can’t get page content in WordPress
- How can I load a PHP page without using a Template?
- Best practice for migration friendly images in posts/pages?
- Page Automatically Generated from Theme?
- Sort query_posts for Parent Pages to menue order or the count?
- How to hide all child pages with post_query?
- Change “add to cart” button color based on Woocommerce product category [closed]
- My page.php shows the index.php
- Populate editor with some content of a page with a page template
- php syntax : [ && ] between commands [closed]
- get_the_title() gets printed out twice
- Using the_excerpt() on a page
- Inject class in body when particular page template is used
- Use WordPress function in php file
- Custom PHP script throws critical error ONLY when editing page
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Need to put a script above tag in header.php – WP 5.7.1
- AJAX button action in foreach
- element not working in Safari [closed]
- Hardening uploads folder in IIS breaks images
- WordPress comment submit button substitutes/options
- Show About and Contact Us page when they’re clicked in the top menu.
- Parsing Menu Items and Blog Posts
- How to use theme function in post/page?
- My php code is not being executed
- Function won’t run onclick using Ajax
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- Can a page contain php code?
- How to remap one of the TinyMCE Advanced Editor button to open the wordpress media library?
- Insert page content into another page with a changed variable
- How to echo every parent page title?
- Retrieve Json data and create multiple pages with it
- How to add page numbering with php?
- Noindex subscriber author page
- How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?
- Removing custom sort order from admin page listing
- $wpdb->get_results breaking page?
- List all anchor links on a page
- Page not visible in ‘All pages’ after being added through PHP
- My worpress search page is showing no results
- Add a product category to a specific product via a button
- Send an e-mail on address with the link with disliked post
- Change button link to add nonce
- Split post or page content in two or more columns
- How to add a PHP scripts into WordPress
- How to edit button permalink inside function.php using a child theme?
- How do I add this OnClick event script to a custom button I’ve created?
- How do I stop my form from adding code to current page URL instead of re-directing. Been stuck for days
- Static Page with php echo [duplicate]
- Add Custom Taxonomy into Script
- loading a php file to a specific page id
- Getting page / post URL on publish and / or update
- how to call other plugins once custom post has been inserted
- How to associate dynamic PHP page for chosen WordPress tag?
- Create a custom theme-specific page, invisible in the admin-panel?
- Replace content in WordPress Page after GET from php page
- List of child pages fetch next results at link click
- Manipulate database of WordPress site with my own scripts
- How to use PHP code with wordpress page
- Auto create description in post
- Trying to put a search page on site
- I want Page titles and excerpts to show up on home.php in certain order
- ACF: Echo page title when checkbox is checked
- Create a custom page URL
- Hide page title
- I can’t seem to get excerpts showing inside get_pages and don’t know why?
- Forbid certain users to access a specific page
- How to return a Boolean for a page that is a subpage thru its name?
- Create an if statement based on page_id
- PHP warning $post->ID is null
- Data insertion after clicking a button does not work (script, AJAX, PHP)
- WordPress post-template null warnings