Contact Us

|

FriendFeed FriendFeed

|

follow us on twitter Twitter

|

 Rss Feed

|

Favorites Add to Favorites

Thursday, March 10, 2011

Toggle select and unselect checkbox with text

Here is a simple javascript to toggle between selected and unselected of a checkbox. And also it will toggle the text, for example when you click on the select link the text will change to unselect and the vise-verse...


function ToggleCheckBox()
{
var ischecked=document.getElementsByTagName("input");
var divid=document.getElementById('id name');
for(i=0;i<ischecked.length;i++)
{
if(ischecked[i].type == "checkbox")
{
if(ischecked[i].checked == true)
{
divid.innerHTML="Select All";
ischecked[i].checked=false;
}
else
{
divid.innerHTML="Deselect All";
ischecked[i].checked=true;
}
}
}

}

Labels: , , ,

13 Comments:

Blogger Thiru Moorthy said...

Thanks for your grateful informations, am working in Web Design Company in Bangalore

October 17, 2013 at 8:46:00 PM PDT  
Blogger nishu kumar said...

Thanks. It's awesome ,it is realy helpful

Searchinfomedia

November 21, 2013 at 9:26:00 PM PST  
Blogger anshu kr said...

Thanks for sharing these information's your tips are really good.
Searchinfomedia

November 25, 2013 at 9:32:00 PM PST  
Blogger minu srivastav said...

Thanks for the sharing of such information. we will pass it on to our readers. This is a great reading. Thanking you.
Searchinfomedia

December 5, 2013 at 12:00:00 AM PST  
Blogger andrew vatts said...

Nice Blog and Providing Useful information.A very inspiring post as well as inspiring taught thus, I really appreciate it! Thanks.

Searchinfomedia

December 13, 2013 at 10:05:00 PM PST  
Blogger VonExpy Softech said...

This kind of websites helps in getting the answers for the technical questions posted. Thanks for providing great service.
software development services

December 28, 2014 at 6:19:00 AM PST  
Anonymous Omega Softwares said...

Thankyou sir for sharing with us such a useful code..
Website Development in Mumbai and CMS Website Design


December 29, 2014 at 12:05:00 AM PST  
Anonymous osiel webs said...

thanks For Sharing
A great online marketing compay, PPC Expert For Tech Support by osiel web

PPC Expert For Tech Support
ppc tech support

ppc management experts | technical support ppc expert

December 29, 2014 at 8:43:00 AM PST  
Blogger Krsitconsulting said...

I like this blog because it shares amazing information.
It is very interested according to my views.
Thanks, and keep up the good works.
Website development

January 8, 2015 at 12:42:00 AM PST  
Anonymous Daniel Nash said...

Synram Technolab offers all possible wordpress services ranging from custom wordpress theme development , plugin customization, wordpress speed optimization, SEO, and integration with 3rd party modules and application like facebook app or for creating Facebook Apps for your WordPress website.

February 23, 2015 at 5:44:00 AM PST  
Blogger Pnp Universe said...

Web-Development

May 22, 2015 at 4:51:00 AM PDT  
Blogger MCS EVEING 10-12 said...

It is really good website because it shares amazing information.
Thanx

April 15, 2016 at 12:09:00 AM PDT  
Blogger Leanberg Technologies said...

Thank you for sharing this information which is helpful for better Website Development environment.

Graphic Design

July 14, 2016 at 4:39:00 AM PDT  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home