Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

chris92

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    chris92 reacted to Lyndsey in Change the value of a html element using jquery   
    Something like this? http://jsfiddle.net/LyndseyB/8fe7F/
     
    I've added a container div and some classes so that you can basically duplicate your HTML to another select element and also validate that with the same code.
     
    Hope it helps.
  2. Like
    <table> <?php $cat_set = get_all_cats(); while($category = mysql_fetch_array($cat_set)){ if($category["category"] != "no-cat"){ echo " <tr data-show=\"".$category["category"]."\"> <td id=\"cats\">".$category["category"]."</td> <td><img id=\"blink\" src=\"drop.png\"></td> </tr>"; $course_set = get_courses_for_cats($category["cat_id"]); while ($course = mysql_fetch_array($course_set)) { echo" <tr class=\"cont\" data-cat=\"".$category["category"]."\"> <td><input value = ". $course["course_code"] ." name=\"boxes[]\" type=\"checkbox\" /></td> <td class=\"code\">" . $course["course_code"] . "</td> </tr>"; } } else { $course_set = get_courses_for_cats($category["cat_id"]); while ($course = mysql_fetch_array($course_set)) { echo" <tr class=\"cont\" data-cat=\"".$category["category"]."\"> <td><input value = ". $course["course_code"] ." name=\"boxes[]\" type=\"checkbox\" /></td> <td class=\"code\">" . $course["course_code"] . "</td> </tr>"; } } } ?> </table> <script> $(document).ready(function(){ $(".cont").hide(); $("[data-show]").click(function(){ var selector = $(this).attr("data-show"); $("[data-cat='"+selector+"']").toggle(); }); }); </script>
  3. Like
    Hiya,
     
    When posting code, ensure you use the code tags as it's a lot easier for us to read
     
    I'd probably use some classes and data attributes. Something like this:
     
    http://jsfiddle.net/LyndseyB/LfA8Q/
     
    However, you'd probably be better off not using a table and using some divs. Would be easier to target elements without using multiple classes etc.
     
    Hey Chris, code tags are located on the text editor (circled below):
     

     
    Hope this helps.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.