I'm trying to paste in some code from codemyui.com into my website, but it looks like there's an error in the javascript. Can someone more familiar with javascript help me?
https://codepen.io/nenadkaevik/pen/odyrGm
var tabs = $('.tabs');
var selector = $('.tabs').find('a').length;
//var selector = $(".tabs").find(".selector");
var activeItem = tabs.find('.active');
var activeWidth = activeItem.innerWidth();
$(".selector").css({
"left": activeItem.position.left + "px",
"width": activeWidth + "px"
});
$(".tabs").on("click","a",function(e){
e.preventDefault();
$('.tabs a').removeClass("active");
$(this).addClass('active');
var activeWidth = $(this).innerWidth();
var itemPos = $(this).position();
$(".selector").css({
"left":itemPos.left + "px",
"width": activeWidth + "px"
});
});
Dreamweaver says that in line two selector is assigned a value but never used and CodePen says that $ is not defined in the same place.