Skip to content

Instantly share code, notes, and snippets.

@joeSaad
Created November 22, 2015 06:48
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 joeSaad/b8a956ffe81a7ad49b0e to your computer and use it in GitHub Desktop.
Save joeSaad/b8a956ffe81a7ad49b0e to your computer and use it in GitHub Desktop.
<style>
.tech-name span {
border:1px solid #eee;
padding: 4px;
background-color: lightgrey;
border-radius: 2px;
box-shadow: 2px 2px 2px #aaa;
}
.tech-name span:hover {
background-color: #eee;
cursor: pointer;
}
</style>
<div class="tech-name">PHP, Classic ASP, Python, Perl</div>
$('.tech-name').each(function() {
var words = $(this).text().split(',');
$(this).empty().html(function() {
for (i = 0; i < words.length; i++) {
if (i == 0) {
$(this).append('<span>' + words[i] + '</span>');
} else {
$(this).append(' <span>' + words[i] + '</span>');
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment