JSFiddle - React, Tailwind, and code Playground

by abdennour

HTML

<script src="http://dl.dropboxusercontent.com/u/55765722/delivred/abdennour/lib/js/underscore/underscore.js"></script>
<script src="http://dl.dropboxusercontent.com/u/55765722/delivred/abdennour/lib/js/underscore/underscore.string.js"></script>
<p>
    <a href="#box1az" >img1</a>
    <a href="#box2az" >img2</a>
    <a href="#box3az" >img3</a>
    <a href="#box4az" >img4</a>
</p>
<div style="font-size:30px"></div>

JavaScript

_.mixin(_.str.exports());
var pre="#box"
var suf="az"
$('a').click(function(){
    var all=$(this).attr('href');
  $('div').html(retrieveNumber(all,pre,suf))
})


function retrieveNumber(all,prefix,suffix){
 var left=_(all).strRight(prefix);
 return _(left).strLeft(suffix);
    
}