need a little help finishing this code;
$(document).ready(function() {
var username = $('div.subtitle span').text();
var $Head = $('div.main-content #field_id4 dt span');
var $body = $('div.main-content #field_id5 dt span');
var $contBody = $('div.main-content #field_id6 dt span');
var $borders = $('div.main-content #field_id7 dt span');
$Head.filter(':contains("Black")')
.closest('#profile-advanced-layout')
.prepend('<div id="blackbg">'+ username +'Profile</div>');
$body.filter(':contains("Black")')
.closest('#profile-advanced-layout')
.css({'background':'#000'});
$contBody.filter(':contains("Black")')
.find('.main-content')
.css({'background':'#000'});
$borders.filter(':contains("Black")')
.find('main-content')
.css({'border':'2px solid #000'});
});
My biggest problem here, since this is only maybe third time using variables. Though if you look at the variable $username
, what I am trying to do is search inside the div .subtitle
span and get the text string that is within that span, then copy it or whatever,
then where is says $Head.filter
, I want it to be "+username+Profile", is that correct for the variable to be in placed like that. And how would i go about finding that text string correctly?