Created
May 23, 2016 18:10
-
-
Save mjordan/48ea77aa2e363b818e99c597b00579b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$(document).ready(function() { | |
$("dd").each(function() { | |
// Value of the <dd> cannot contain only puncutation or be empty. | |
if ($.trim($(this).text()).match(/^[.,::\-]$/g) || $.trim($(this).html()) == '') { | |
// Hide the <dd>. | |
$(this).hide(); | |
// Hide the corresponding <dt>. | |
$(this).prev().hide(); | |
} | |
} | |
)}); | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$(document).ready(function() { | |
$("dd").each(function() { | |
if ($.trim($(this).html()) == '') { | |
// Hide the empty <dd>. | |
$(this).hide(); | |
// Hide the corresponding <dt>. | |
$(this).prev().hide(); | |
} | |
} | |
)}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment