Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>Bookmarklet maker / Favelet maker</h1>
<label for="txar">%code%:</label>
		<dt>Due "inline" nature of bookmarklet, you shall:
		<dd>- not use line commnets (<strong>//</strong>) ever (or even better do not comment at all)
		<dd>- use semicolons (<strong>;</strong>) between statements
<textarea cols="70" rows="30" wrap="off" id="txar" onkeyup="hrefize()">
alert('Hello, ' + document.title);
This code will be straightforwardly inlined, so:
-	semicolons everywhere
-	no inline comments
Also, no transforms, sanitizing and so on will be made.

<label for="titlel">%title%:</label> 
<input id="titlel" type="text" onkeyup="hrefize()" value="Hello" />

<label>Your Resulting Bookmarklet:</label>
<span data-note="just wrapper for innerHTML retrieval" class="the_wrapper"><a
	id="lnk" title="here will be title" href="#here_will_be_generated_javascript_uri"
>here will be title</a></span> – right click &amp; bookmark it OR drag it into bookmark toolbar.
<p><label for="check">Actual result:</label> &lt;a
	href="javascript:(function(){inlinized <label for="txar">%code%</label>})();"
	title="<label for="titlel">%title%</label>"&gt;<label for="titlel">%title%</label>&lt;/a&gt;
<p><textarea id="check" rows="5"></textarea>
<h2>Some bookmarklets</h2>
<dl class="bmls">
 <dt><a id="set_body_width" href="javascript:(function(){document.getElementsByTagName('html')[0].style.width=document.getElementsByTagName('body')[0].style.width=prompt('body%20width?','2000px')})();">Set body width</a>
	 <dd>test pages display in viewport larger than yours.
 <dt><a id="reformat_and_pretty_print_javascript_source" title="JS prettyPrint" href="javascript:(function(){var pre = document.getElementsByTagName('pre'); if( !pre || !pre.length ) throw 'No PRE tag found'; pre = pre[0]; if ( pre.className.indexOf('prettyprinted') > -1 ) throw 'You shall not overprettify!'; pre.className = 'prettyprint lang-js'; = 'none'; = '0px'; = '4'; = '4'; var prettify_css = document.createElement('link'); prettify_css.type = 'text/css'; prettify_css.rel = 'stylesheet'; prettify_css.href = ''; prettify_css.href = ''; var beautify = document.createElement('script'); beautify.type = 'text/javascript'; beautify.src = ''; beautify.onload = function () { pre.innerHTML = js_beautify(pre.innerHTML, {jslint_happy:1,indent_size:1,indent_char:'\t'}); document.body.appendChild( prettify_js ); document.body.appendChild( prettify_css ); }; var prettify_js = document.createElement('script'); prettify_js.type = 'text/javascript'; prettify_js.src = ''; prettify_js.onload = function () { prettyPrint(); }; document.body.appendChild( beautify );})();">JS prettyPrint</a>
 	<dd>when viewing source, fire up <a href=""></a>'s magic and then colour it with <a href="">google-code-prettify</a>
<h2>Some libraries</h2>
<dl class="bmls">
 <dt>Slayeroffice Favelet Suite
 	<dd><a href=""></a>
 <dt>Squarefree bookmarklet library
 	<dd><a href=""></a>
 <dt>Pixy's "Let's Favelets"
 	<dd><a href=""></a>
 <dt>Kevin Smith's "Favelets - Some Folks Call Them Bookmarklets"
 	<dd><a href=""></a>


html *{font-family:"Courier New",monospace}

dt a,
	border: outset black;
	background-color: black;
	padding: 5px; 
	display: inline-block;

:target {
	border-color: red !important;
	font-size: 2em;
	padding: 0.2em;

textarea {
	width: 99%;
	-moz-tab-size: 4;
	tab-size: 4;

#titlel {
	width: 50%;
button {
	background-color: transparent;
	color: #ccc;
button dl {
	display: none;
button:focus {
button:focus dl {
	display: block;	
h1, h2 {
	font-size: 1em;
	font-weight: normal;
.the_wrapper {
	border: 3px solid yellow;
	display: inline-block;


                var txar = document.getElementById('txar');
var lnk = document.getElementById('lnk');
var check = document.getElementById('check');
var titlel = document.getElementById('titlel');

// txar.focus();

function hrefize()
{	var src = txar.value
		.replace( /\n/g, ' ' )
		.replace( /\s\s*/g, ' ' )
		.replace( /^ | $/g, '');
;	var pref = '(function(){'
;	var suff = '})();'
;	if ( src.indexOf( pref ) == 0 )
	{	pref = ''
	;	suff = ''
;	lnk.href 
	=	'javascript:'
	+	pref
  	+	src
  	+	suff
;	lnk.title = lnk.innerHTML = titlel.value
;	check.value = lnk.parentNode.innerHTML