Skip to content

Instantly share code, notes, and snippets.

@mjordan
Created May 23, 2016 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjordan/48ea77aa2e363b818e99c597b00579b0 to your computer and use it in GitHub Desktop.
Save mjordan/48ea77aa2e363b818e99c597b00579b0 to your computer and use it in GitHub Desktop.
(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);
(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