How to Change the Text of a Button using jQuery

Topic: JavaScript / jQuery Prev | Next

Answer: Use the jQuery prop() and html() Methods

You can simply use the jQuery prop() method to change the text of the buttons built using the HTML <input> element, whereas to change the text of the buttons which are created using the <button> element you can use the html() method.

The jQuery code in the following example will change the button text on document ready:

Related FAQ

Here are some more FAQ related to this topic:

  • How to toggle text inside an element on click using jQuery
  • How to get the text inside an element using jQuery
  • How to add elements to DOM in jQuery

Bootstrap UI Design Templates

Is this website helpful to you? Please give us a like , or share your feedback to help us improve . Connect with us on Facebook and Twitter for the latest updates.

Interactive Tools

BMC

  • jQuery Tutorial
  • jQuery Selectors
  • jQuery Events
  • jQuery Effects
  • jQuery Traversing
  • jQuery HTML & CSS
  • jQuery AJAX
  • jQuery Properties
  • jQuery Examples
  • jQuery Interview Questions
  • jQuery Plugins
  • jQuery Cheat Sheet
  • jQuery Mobile
  • Web Technology

Related Articles

  • Solve Coding Problems
  • How to get N options from the <select> element using JQuery?
  • jQuery Misc each() Method
  • jQuery UI | Tooltip
  • jQuery | Misc get() Method
  • How to create automatic pop-up using jQuery ?
  • How to check an element is visible or not using jQuery?
  • How to get index of object inside an array that matches the condition in jQuery ?
  • How to call a function automatically after waiting for some time using jQuery?
  • JQuery | isEmptyObject() method
  • jQuery | Move an element into another element
  • How to create To-Do List using jQuery?
  • How to append an element in two seconds using jQuery ?
  • How to remove table row from table using jQuery ?
  • jQuery UI | show() Method
  • How to scroll automatically to a particular element using JQuery?
  • jQuery | Misc toArray() Method
  • How to calculate the number of words in a string using JQuery?
  • How to unbind “hover” event using JQuery?
  • Opening google search results simultaneously in new tabs in Chrome

How to Change the Text of a Button using jQuery?

  • Get the text from the <input> element.
  • FIRST matched element is taken on the basis of para1.
  • Change the value set for the selected element from para1 to para2.

change button function jquery

  • Get the text from the <button> element.
  • It matches the selector element.
  • Change the value set for the selected element to content.

change button function jquery

Please Login to comment...

  • jQuery-Misc
  • Web Technologies

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Change Button Text using JQuery

Change Button Text using JQuery

In this tutorial we will see how to Change Button Text using JQuery . JQuery .html() method is used for this, which will update the text of button.

Table of Contents

HTML Code is given below.

JQuery Code

JQuery Code is given below. JQuery html() method sets or returns the inner content of the selected html element.

In this code whenever the click event occurs, a function is executed which changes the text of html button with help of html() method.

Video Tutorial

Watch video tutorial on how to Change Button Text using JQuery .

More JQUERY Tutorials

Ace your Coding Interview

  • DSA Problems
  • Binary Tree
  • Binary Search Tree
  • Dynamic Programming
  • Divide and Conquer
  • Linked List
  • Backtracking

Change text of a button with JavaScript/jQuery

This post will discuss how to change the text of a button in JavaScript and jQuery.

The button element is now preferred way to create buttons over <input> element of type button. There are several ways to change the button ‘s label text, which is inserted between its opening and closing tags.

1. Using jQuery

With jQuery, you can use the .text() method to replace the button ‘s label text. This is demonstrated below:

Edit in JSFiddle

  Note that the .text() method will escape the provided text as necessary to render correctly in HTML.

  Alternatively, you can use jQuery’s .html() method to replace an element’s content with the new content completely. It uses the browser’s innerHTML property and doesn’t escape the provided text, leading to cross-site security attacks.

2. Using JavaScript

In pure JavaScript, you can use either innerHTML , innerText or textContent to write text inside an element. Among them, textContent has better performance because its value is not parsed as HTML, and it also prevents XSS attacks.

That’s all about changing the text of a button in JavaScript and jQuery.

Change value of a button with JavaScript/jQuery
Replace text of an anchor tag with JavaScript/jQuery
Get href value of an anchor tag with JavaScript/jQuery

Rate this post

Average rating 4.14 /5. Vote count: 50

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Tell us how we can improve this post?

Thanks for reading.

To share your code in the comments, please use our online compiler that supports C, C++, Java, Python, JavaScript, C#, PHP, and many more popular programming languages.

Like us? Refer us to your friends and support our growth. Happy coding :)

change button function jquery

Software Engineer | Content Writer | 12+ years experience

guest

  • Skip to primary navigation
  • Skip to main content

The Programming Expert

Solving All of Your Programming Headaches

How to Use jQuery to Change Button Text

November 25, 2021 Leave a Comment

To change button text using jQuery, the simplest way is to use the jQuery text() method:

You can also use the jQuery html() method to change button text.

Let’s say I have the following HTML form:

If I want to change the button text inside from “Send” to “Submit”, I can use the jQuery text() method to do this with the following Javascript code.

If you are using WordPress, don’t forget to change the $ to jQuery as below:

We can also use the jQuery html() method to change the content of the button.

While the text() method is very simple, the html() method gives us the ability to insert html into our button, which gives us more options when styling the content. In this case, with buttons, using the html() method probably wouldn’t make sense.

Changing Button Text Using jQuery with a Click

To change button text using jQuery, we can combine the text() method with a click event.

Let’s say I have the following HTML form, and I want to give the user the ability to change the button text from “Send” to “Submit”.

We can utilize both the jQuery click() method and jQuery text() method to change the button text from “Send” to “Submit”.

Below is the Javascript code which will allow the user to be able to update the text in the submit button:

The final code and output for this example of how to change the text of a submit button using the jQuery text() method and Javascript is below:

Code Output:

Hopefully this article has been useful for you to understand how to change button text with jQuery.

Other Articles You'll Also Like:

  • 1 .   Using jQuery to Set Visibility
  • 2 .   jQuery Random Number Generator Between Two Numbers
  • 3 .   jQuery prev – Get the Previous Element of a Div
  • 4 .   jQuery mouseenter – An Interactive Example of the mouseenter Method
  • 5 .   Using jQuery to Add id to div
  • 6 .   jQuery after – Insert HTML After Another Element
  • 7 .   Using jQuery to Change Background Color
  • 8 .   How to Filter a List of Divs with a Text Input Bar Using Javascript
  • 9 .   jQuery hover – An Interactive Example of the hover Method
  • 10 .   Using jQuery to Hide Element by Class

About The Programming Expert

change button function jquery

The Programming Expert is a compilation of a programmer’s findings in the world of software development, website creation, and automation of processes.

Programming allows us to create amazing applications which make our work more efficient, repeatable and accurate.

At the end of the day, we want to be able to just push a button and let the code do it’s magic.

You can read more about us on our about page.

Reader Interactions

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

Define a Function and Trigger It Onclick Using jQuery

Define a Function and Trigger It Onclick Using jQuery

This jQuery tutorial helps you define a function and invoke it when a button is clicked. We will explore various ways to define jQuery functions and demonstrate their usage through examples.

There are very common tasks in any web application Like defining functions that execute when a user interacts with a web page, such as clicking a button.

Prerequisites

Please Make sure you have jQuery integrated into your web project. You can do this by adding the jQuery library through a CDN (Content Delivery Network) or by downloading it and hosting it locally .

Create a Function and Trigger It onClick() of the Button

You can use either the onclick attribute or the jQuery click event with the click() function to invoke a function when a click event occurs. Create a directory named ‘jquery-example’ and within this directory, generate a fresh file named ‘index.html’ .

Import jQuery

Include jQuery in the head section of your file.

Defining a Function with jQuery

Let’s create a setTitle() method into the index.html file.

in the above code have defined setTitle() function, it uses jQuery to select an HTML element with the ID ‘title’ and changes its text to “js-tutorials.com!” when called.

Call jQuery Method onclick of Button

We’ll call the above method inside the $(document).ready() function. This method helps to execute code only after the HTML document is fully loaded.

In the above code, we have attached a click event with a button, which triggers the setTitle function.

Passing Parameters to a Click Event Function

Sometimes, we need to parameters to the function triggered by a click event.

in the above code, we have defined the anonymous function inside the click() event handler, that will invoke the method when the user clicks the button, this will call the setTitle() method and change the text.

We have learned about jQuery method creation and method invoking on onclick event. Also, attached click event handlers and pass parameters to functions on the click of the method.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CodeHunger Blog

Change Button Text On Click using jquery

Photo of Shaiv Roy

In this article, we will learn about, how we can change button text on click, in jquery. I will show you step by step how we can change button text on click.

We will use html method to change button text on click. This kind of thing we need during the development of certain application.

To do this we will follow the below step

  • Create a html file
  • Write the code
  • Test the Code

Step: 1 Create a html file

we will create a html file under the htdocs folder.Before the creating the html file. Let’s create a folder named as learn-javascript under that folder create file named as index.html

Step: 2 Write the code

Now open your index.html file in your favorite text editor or IDE, I am using visual studio code for that, you can also do it in notepad or notepad++

Write the below code in your index.html file

change button function jquery

Step:3 Test the code

Now we will test our code, go to browser and in the address bar enter the url http://localhost/learn-javascript/, once you hit enter something like below will be open.

change button text on click

When you click on the button the text will be changed

change button function jquery

Read Also: How to get value of selected option

I hope you understand the basic concept of changing the button text on click

Photo of Shaiv Roy

What is Domain and Subdomain in website development?

Importance of website in business, why react is better than angular, copy text to clipboard in vue js, companies using vue.js, lazy loading image in vue js, how to dynamically add/remove table row in jquery with example, use v-select in vue js, vue js download file via laravel api, javascript conditional operator or ternary operator, are you looking for website/app development will do it for $5 per hour.

Don't think too much let's begin.

Crud Operation in PHP

C++ tutorial for beginner, related articles.

change button function jquery

React Js Phone Number Validation Example

change button function jquery

Angular Material Selected Tab Change Event Example

call method from non parent child component

VueJs – How to call a method from non-parent-child component in vue-js

change button function jquery

Array.splice() vs Array.slice()

Leave a reply cancel reply.

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

change button function jquery

WhatsApp us

StackHowTo

  • How to change the text of a button in jQuery

I n this tutorial, we are going to see how to change the text of a button in jQuery. You can use jQuery’s prop() method to edit the text of buttons built with the <input> tag, while you can use the html() method to edit the text of buttons built with the <button> tag.

The jQuery code in the example below will modify the button text when the document is ready:  

mcq

  • jQuery MCQs – Multiple Choice Questions and Answers – Part 1
  • jQuery MCQs – Multiple Choice Questions and Answers – Part 2
  • How to detect a click on iframe in JQuery
  • How to find sub-string between the two words using jQuery
  • How to Get Substring from a String Using jQuery
  • How to remove all spaces from a string with jQuery
  • How to count number of characters in a string with JQuery
  • How to count words using JQuery
  • How to loop through array with jQuery.each()?
  • How to show/hide DIV based on Radio Button click
  • How to show/hide DIV if checkbox selected

How to show/hide DIV on selection of ANY drop-down value?

  • How to define a function in jQuery?
  • How to Call a Function After Some Time in jQuery
  • How to add CSS properties to an element dynamically with jQuery
  • How to add attribute to an HTML element in jQuery
  • How to Remove Attributes from HTML Element in jQuery
  • How to add DOM element in jQuery
  • How to Remove Elements from DOM in jQuery
  • How to disable href link in jQuery
  • How to check if a checkbox is checked with jQuery
  • How to get the value of selected radio button with jQuery
  • How to get the value of a CheckBox with jQuery
  • How to bind onclick event to dynamically added HTML element with jQuery
  • How to get the value of a select with jQuery
  • How to get the current URL using Jquery
  • How to remove a tag without deleting its content with jQuery
  • How to get the text content of an element with jQuery
  • How to check if an element is visible with jQuery

How to find mouse position relative to element with jQuery

  • How to find mouse position relative to the document with jQuery
  • Show read more link if the text exceeds a certain length with jQuery
  • jQuery slideup() slidedown() and slidetoggle() Example
  • How to slide toggle a DIV from Left to Right?
  • How to disable/enable submit button in jQuery
  • How to disable all <input> inside a form with jQuery?

How to check and uncheck a radio button using jQuery

  • How to check and uncheck a checkbox with a button using jQuery
  • How to move an element with arrow keys in jQuery
  • How to get selected file name from Input Type File using jQuery
  • How to check if an element is hidden in jQuery
  • How to Redirect to Another Web Page Using jQuery and JavaScript
  • How to insert HTML content into an iFrame with jQuery
  • Auto-update DIV content while typing in textarea with jQuery
  • How to Add or Remove Table Rows Dynamically with jQuery
  • How to change the href for a hyperlink with jQuery
  • How to refresh a page with jQuery
  • How to Get Number of Elements inside a DIV with jQuery
  • How to Check If a Value is Numeric or Not in jQuery
  • How to detect pressing Enter on keyboard using jQuery
  • How to detect the Enter key in a text input field using jQuery
  • How to get the value of a textarea in jQuery
  • How to reset a form using jQuery
  • How to check if the input is empty with jQuery
  • How to display the value of the input in DIV in real-time with jQuery
  • How to detect a click outside an element with jQuery
  • How to Loop Through Elements with the Same Class in jQuery
  • How to Change the Value of an Input in jQuery
  • How To Change CSS Style With jQuery
  • How to Get the Value in an Input Text Box using jQuery
  • How to Set CSS background-image Property Using jQuery
  • How to Detect a Mobile Device in jQuery
  • How to Get the data-id Attribute of an Element In jQuery
  • How to Add <li> in an Existing <ul> with jQuery
  • Get data from a database without refreshing the browser using Ajax
  • Submit Form Without Page Refresh Using Ajax, jQuery, and PHP
  • How to show/hide a div with a slide effect in jQuery
  • How to get URL parameters using jQuery
  • How to get form data with JQuery
  • Submit a Form Using Jquery Ajax
  • Scroll to the top of the page using jQuery
  • Triggering a CSS animation with Jquery

You May Also Like

how-to-check-and-uncheck-a-radio-button-using-jquery

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Save my name, email, and website in this browser for the next time I comment.

JS Reference

Html events, html objects, other references, onclick event.

Call a function when a button is clicked:

More examples below.

Description

The onclick event occurs when the user clicks on an HTML element .

Mouse Events

The Mouse Event Object

JavaScript Events

In JavaScript:

In JavaScript, using the addEventListener() method:

Technical Details

Advertisement

More Examples

Click a <button> to display the date:

Click a <h3> element to change the text color:

Another example on how to change the color of an element:

Click to copy text from one input field to another:

How to assign an "onclick" event to the window object:

Use onclick to create a dropdown:

Browser Support

onclick is a DOM Level 2 (2001) feature.

It is fully supported in all browsers:

Get Certified

COLOR PICKER

colorpicker

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

[email protected]

Top Tutorials

Top references, top examples, get certified.

  • Inspiration
  • Website Builders

In This Article

Disable button on click, disabling submit button when textarea is empty, disabling submit button when input is empty, disable button on page load, enabling button with jquery, checking if the button is disabled or enabled with jquery, disable button with javascript, related articles, disable button in jquery [with examples].

Alvaro Trigo Avatar

Follow on Twitter

Updated on: February 08, 2024

To disable a button with jQuery you need to set the disabled property on the button using the prop method. For example $('.my-button').prop('disabled', true) .

Here’s the step by step process:

  • Select the button you want to disable.
  • Use the jQuery prop method.
  • Set the disabled property to true
The prop method admits two parameters. The first is the property we want to set and the second is the value we want to give to such property. (Or a function that returns a value)

Table of contents:

So, let’s say we have a button and we want to disable the button when clicking in another button:

This is the jQuery code we will need:

This is a very common scenario that we can find in plenty of web applications or websites. In those cases where it makes no sense to submit a form with an empty textarea , it’s a good practice to disable the submit button when their textarea has no content.

All we have to do is:

  • Attach the keyup event to our textarea element
  • Retrieve the value of the textarea
  • Remove white trailing whitespaces
  • Disable the submit button when the value is empty.

Let’s say we have the following HTML code with our textarea and our button:

This would be our jQuery code:

Remember that the second parameter of the prop method also allows us to use a function instead of a boolean?

We can test it out in this same example by replacing our previous code with the following one, where we just return a boolean value on the function we pass as a parameter.

The same exact technique we used for the textarea can be applied for any other input.

I updated the id attribute and the function name but the rest is all the same:

The easiest way to show a button as disabled on page load is by directly assigning to it the disabled attribute on the HTML code:

However, if for any reason you need to do this dynamically and you have no way to modify the HTML code, you can still do this using jQuery.

It is as simple as disabling it on document ready:

As you’ve probably guessed, enabling a button is as simple as disabling it. In fact, we will be using the exact same prop method. The only difference is that now we’ll set the value for disabled to false instead of true .

Here’s an example:

To check the state of a button all we have to do is get the value of the disabled property.

The prop method not only provides us a way to set the properties but also allows us to check their state too. It’s as simple as omitting the second parameter:

If jQuery is not your thing, you can disable a button with vanilla JavaScript (aka, with just JavaScript).

To disable a button with JavaScript you need to set the disabled property to true by directly setting the value to the property disabled on the DOM element. For example: document.querySelector('#my-button').disabled = true .

So, here’s the equivalence:

Then you would also need to change the respective event listeners if you use any.

Here’s an example of how to disable the button after click using JavaScript:

  • jQuery .prop() method
  • Disabled property (MDN Web Docs)
  • Replace Text with jQuery (With Examples)
  • Check If Checkbox Is Checked with jQuery
  • JavaScript Alert (Examples and Usage)
  • Prevent Scroll On Scrollable Elements

cropped yo 160.jpg

Alvaro Trigo

I’m Alvaro, a full-stack web developer and a full-time entrepreneur. Creator of fullpage.js . You can follow me at Twitter .

Don’t Miss…

jquery radio button checked share

  • Legal Notice
  • Terms & Conditions
  • Privacy Policy

A project by Alvaro Trigo

IMAGES

  1. How to Change Button Text Using JQuery

    change button function jquery

  2. Change Button Text Using jQuery

    change button function jquery

  3. Change Button Text using JQuery

    change button function jquery

  4. The jQuery change Function

    change button function jquery

  5. Change HTML Button Text using JQuery

    change button function jquery

  6. jQuery change() Method

    change button function jquery

VIDEO

  1. change Event || jQuery

  2. Task -1: jQuery Basics and Add TextBox value to Drop Down on button click

  3. mini tutorial how to change button color on the ptem

  4. Change button colour on clicking in html css #python #pythontricks #html #htmlcss #css

  5. Click event on dynamically created button or element in jquery

  6. How to set/use change volume button function in Oneplus nord ce 3 lite 5g। oneplus nord ce 3 lite

COMMENTS

  1. Change the button's function with jQuery?

    4 Answers Sorted by: 11 Something like the below code would work. $ ("#click-button").on ('click', firstClick) function firstClick () { alert ("First Clicked"); $ ("#click-button").off ('click').on ('click', secondClick) } function secondClick () { alert ("Second Clicked"); $ ("#click-button").off ('click').on ('click', firstClick) }

  2. jQuery change() Method

    $ ("input").change(function() { alert ("The text has been changed."); }); Try it Yourself » Definition and Usage The change event occurs when the value of an element has been changed (only works on <input>, <textarea> and <select> elements). The change () method triggers the change event, or attaches a function to run when a change event occurs.

  3. change event

    This page describes the change event. For the deprecated .change () method, see .change (). The change event is sent to an element when its value changes. This event is limited to <input> elements, <textarea> boxes and <select> elements.

  4. Change value of a button with JavaScript/jQuery

    This post will discuss how to change the value of the <input> element of type button or submit in JavaScript and jQuery. 1. Using jQuery With jQuery, you can use the .val () method to set values of the form elements.

  5. How to Change the Text of a Button using jQuery

    Answer: Use the jQuery prop () and html () Methods. You can simply use the jQuery prop () method to change the text of the buttons built using the HTML <input> element, whereas to change the text of the buttons which are created using the <button> element you can use the html () method. The jQuery code in the following example will change the ...

  6. How to Change the Text of a Button using jQuery?

    - GeeksforGeeks How to Change the Text of a Button using jQuery? Read Courses Here is the question to Change the Text of a Button using jQuery. To do this task, we can use the following two methods: prop () method: It is used to set property values, it sets one or more property for the selected elements. Syntax: $ (selector).prop (para1, para2)

  7. .on()

    Description: Attach an event handler function for one or more events to the selected elements. version added: 1.7 .on ( events [, selector ] [, data ], handler ) events Type: String One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". selector Type: String

  8. Change Button Text using JQuery

    JQuery Code is given below. JQuery html () method sets or returns the inner content of the selected html element. In this code whenever the click event occurs, a function is executed which changes the text of html button with help of html () method. <script> $ ("#button").click (function () { $ (this).html ("New Text"); }) </script>.

  9. Change text of a button with JavaScript/jQuery

    The button element is now preferred way to create buttons over <input> element of type button. There are several ways to change the button's label text, which is inserted between its opening and closing tags. 1. Using jQuery. With jQuery, you can use the .text() method to replace the button's label text. This is demonstrated below:

  10. How to Use jQuery to Change Button Text

    To change button text using jQuery, the simplest way is to use the jQuery text () method: $ ("button").text ("Submit"); You can also use the jQuery html () method to change button text. $ ("button").html ("Submit"); Let's say I have the following HTML form:

  11. Define a Function and Trigger It Onclick Using jQuery

    Create a Function and Trigger It onClick () of the Button. You can use either the onclick attribute or the jQuery click event with the click () function to invoke a function when a click event occurs. Create a directory named 'jquery-example' and within this directory, generate a fresh file named 'index.html'.

  12. click event

    "click" Type: string The string "click". eventData Type: Anything An object containing data that will be passed to the event handler. handler Type: Function ( Event eventObject ) A function to execute each time the event is triggered. This page describes the click event. For the deprecated .click () method, see .click ().

  13. jQuery Event Methods

    jQuery Syntax For Event Methods. In jQuery, most DOM events have an equivalent jQuery method. To assign a click event to all paragraphs on a page, you can do this: $ ( "p" ). click (); The next step is to define what should happen when the event fires. You must pass a function to the event: $ ( "p" ). click ( function () {.

  14. Change Button Text On Click using jquery

    Change Button Text On Click using jquery Shaiv Roy February 20, 2021 Last Updated: February 20, 2021 0 0 1 minute read In this article, we will learn about, how we can change button text on click, in jquery. I will show you step by step how we can change button text on click. We will use html method to change button text on click.

  15. How to change the text of a button in jQuery

    You can use jQuery's prop () method to edit the text of buttons built with the <input> tag, while you can use the html () method to edit the text of buttons built with the <button> tag. The jQuery code in the example below will modify the button text when the document is ready: How to change the text of a button in jQuery. <!DOCTYPE html ...

  16. onclick Event

    Call a function when a button is clicked: <button onclick="myFunction ()"> Click me </button> Try it Yourself » More examples below. Description The onclick event occurs when the user clicks on an HTML element. Mouse Events See Also: The Mouse Event Object Tutorial: JavaScript Events Syntax In HTML: <element onclick="myScript"> Try it Yourself »

  17. jQuery: Change button text on click

    jQuery: Change button text on click Ask Question Asked 10 years, 4 months ago Modified 2 years, 9 months ago Viewed 149k times 21 After seeing Toggling button text in jquery this question, I tried to re create it in my situation but can't seem to have it work. Here is a fiddle of what I've done: http://jsfiddle.net/V4u5X/

  18. Disable button in jQuery [With examples]

    To disable a button with jQuery you need to set the disabled property on the button using the prop method. For example $ ('.my-button').prop ('disabled', true). Select the button you want to disable. Use the jQuery prop method. The prop method admits two parameters. The first is the property we want to set and the second is the value we want to ...

  19. html

    19.5k 10 39 53 asked Apr 26, 2013 at 16:17 Sean6971 133 1 1 5 $ ('#answer').click ( function () { $ (this).css ( { 'background' : '#00ff00' }); }); Please, refer jQuery documentation for more details about it's functions and API - Mikhus Apr 26, 2013 at 16:21 I hope this isn't homework. And what's with all these duplicate IDs.