Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including jquery-prompt with all npm packages installed. Try it out:

var jqueryPrompt = require("jquery-prompt")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jquery-prompt v1.0.0

jquery prompt plugin for electron or the browser

jquery-prompt

jquery prompt plugin for electron and the browser.

demo: https://angeal185.github.io/jquery-prompt/

Installation

npm

$ npm install jquery-prompt

electron

ensure jquery is installed.

require('jquery-prompt');
<link rel="stylesheet" href="./dist/css/jq-prompt.min.css">

browser

<link rel="stylesheet" href="./dist/css/jq-prompt.min.css">
<script src="./dist/js/jq-prompt.min.js">

info

// prompt string defaults
{
  header: 'prompt', //header text
  type: 'text', //input type
  speed: 'fast', //animation speed
  placeholder: 'cannot be empty', //placeholder text
  cBtn: 'Cancel', //cancel button text
  sBtn: 'Submit', //submit button text
  error: 'cannot be empty' //error msg text
}

// prompt boolean defaults
{
    header: 'prompt', //header text
    speed: 'fast', //animation speed
    cBtn: 'Cancel', //cancel button text
    sBtn: 'Submit' //submit button text
}
//demo

// set global prompt string defaults
$.xPrompt.defaults = {
  placeholder: "test",
  error: "error"
};

// set global prompt boolean defaults
$.xPromptQ.defaults = {
  speed: 'slow'
};

//prompt string demo
//$.xPrompt(options,callback)

$('.ptest').on('click', function(){
  $.xPrompt({header: 'header', placeholder: 'enter text'}, function(i){
    // do something with string
    console.log(i)
  })
})

//prompt boolean demo
//$.xPromptQ(options,callback)

$('.ptestQ').on('click', function(){
  $.xPromptQ({header: 'are you sure'}, function(i){
    // do something with boolean
    console.log(i)
  })
})

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free