Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (78 sloc) 1.8 kB
<!DOCTYPE html>
<script src="//"></script>
<script src="janitor.js"></script>
<style type="text/css">
body {
font-family: helvetica neue;
.code_wrapper {
background-color: #f5f5f5;
padding: 20px;
margin-bottom: 20px;
border-radius: 10px;
border: 1px solid #ddd;
.config_wrapper {
background-color: #f5f5f5;
padding: 20px;
border-radius: 10px;
border: 1px solid #ddd;
h3 {
margin: 0;
padding: 0 0 10px 0;
textarea {
font-family: courier;
Janitor-js &mdash; jQuery plugin for sanitizing HTML
<div class="code_wrapper">
<h3 style="color: #f00">
Dirty HTML
<textarea id="dirty" style="height: 100px; width: 400px"></textarea>
<button id="doit">Sanitize</button>
<h3 style="color: #0c0">
Cleaner HTML
<textarea id="clean" style="height: 100px; width: 400px"></textarea>
<div class="config_wrapper">
<textarea id="config" style="height: 100px; width: 400px">
tags: {
div: [],
ul: [],
li: [],
a: [ 'href' ]
protocols: [ 'http', 'https' ]
<script type="text/javascript">
(function($) {
var execute = function () {
var config;
eval('config = ' + $('#config').val());
$('#clean').val(Janitor.clean($('#dirty').val(), config));
$('#doit').on('click', execute);
Jump to Line
Something went wrong with that request. Please try again.