From 07dbc051876ce001c9530bcf107937da7a3e78d8 Mon Sep 17 00:00:00 2001 From: ADL Walrus Date: Mon, 26 Nov 2012 08:28:31 +0800 Subject: [PATCH] Perhaps we can now unexpose removeAttr from the API? Clean APIs are nice, right? --- bonzo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bonzo.js b/bonzo.js index 3d134d1..164ef60 100644 --- a/bonzo.js +++ b/bonzo.js @@ -858,6 +858,8 @@ * @return {Bonzo|string} */ , attr: function (k, opt_v) { + if(opt_v == null || opt_v == '') + this.removeAttr(k) var el = this[0] if (typeof k != 'string' && !(k instanceof String)) { for (var n in k) {