header parallax image
uncoditional

code liberated

  • Home
  • Pete
  • Home
  • Pete
Uncategorized

Quick way to use checkbox to show/hide a div

July 2, 2014Peter Lombardo1369 views

The following code illustrates a simple show/hide feature, based on status of a checkbox.  The checkbox calls it onClick.

[code language=”javascript”]
myShowHideFunc = function(obj){
var displayMode = (obj.checked)?"none":"inline";
var focusobj = $("#DivToToggle");
$(focusobj).css({‘display’:displayMode});
}
[/code]

I draw your attention to the displayMode variable which is set by the if-then switch to a language that the jQuery css command can understand.

  • tweet
previous story

Simply position the top of the jquery dialog box

next story

Ellipse for Select list in mobile format

Peter Lombardo

Peter Lombardo

Web developer too long.

you might also like

CFScript Components and OO notes

June 12, 2015

real Chrome developer features

October 8, 2014

Proper Formatting of Money in T-SQL

June 27, 2014

Leave a Response Cancel reply

You must be logged in to post a comment.

about me

uncoditional

Pete Lombardo

I like people and the fun of coding in its ever changing state. I've lived in Maryland since I was 2 months old. Its smells and sounds are like an old glove. But I look forward to coding and blogging wherever I wake up tomorrow. I've spent 20 years as a programmer and IT guy, but have never had more fun with this stuff than I do now.

Recent Posts

  • ChromeBook as Development Environment: YMMV
  • Once more into the cloud
  • AWS CloudSearch file/data upload using JDK – code sample
  • programming basics/refresher done right
  • cf – create crud from column names.sql

Recent Comments

    Archives

    • June 2020
    • June 2019
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • June 2017
    • June 2015
    • May 2015
    • April 2015
    • October 2014
    • September 2014
    • July 2014
    • June 2014
    • May 2013
    • February 2013
    • January 2013
    • November 2012
    • October 2012

    Categories

    • AWS
    • before the code
    • Browser Support
    • CFML & Mach-II
    • Chromebook
    • ckEditor
    • CloudSearch
    • ColdFusion
    • Java
    • JQuery and CSS
    • Languages
    • Life
    • Projects
    • SNS
    • SQL
    • Tools
    • Uncategorized
    • unCODitional

    Meta

    • Register
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    0
    Followers
    0
    Followers
    0
    Followers
    0
    Followers

    Follow @ Instagram

    Configuration error or no pictures...