基于javascript改变html

基于javascript改变html,javascript,Javascript,我有一个入侵力量论坛,我正试图使用javascript来更改特定的帐户配置文件,但我似乎无法更改背景。现在在背景选取器上显示 <span id='customprofile' data-backgroundClass='ipsfocus_bg1' style='background-color: {theme="ifBg1_hex"}; {{if theme.ifBg1_image}}background-image: url({theme="ifBg1_image"});{{endif}

我有一个入侵力量论坛,我正试图使用javascript来更改特定的帐户配置文件,但我似乎无法更改背景。现在在背景选取器上显示

<span id='customprofile' data-backgroundClass='ipsfocus_bg1' style='background-color: {theme="ifBg1_hex"}; {{if theme.ifBg1_image}}background-image: url({theme="ifBg1_image"});{{endif}} background-position: {theme="ifBg1_position"}; background-size: {theme="ifBg1_size"}'></span>


对于其中一个后台选项,但我希望能够有一个脚本,如果(比如)url包含“1”,则显示不同的跨距,而不是此跨距,我将在页面中有两个跨距

<span id="special" style="display:none;">Special</span>
<span id="normal"  style="display:none;">Normal</span>
<script>
  var el;

  // check if current page contains a 1
  if (location.href.indexOf("1") !== -1) {
     // select special SPAN
     el = document.getElementById("special");
  } else {
     // otherwiose select normal SPAN
     el = document.getElementById("normal");
  }

  // make it visible
  el.style.display = 'inline';
</script>
特殊
正常的
var-el;
//检查当前页面是否包含1
if(location.href.indexOf(“1”)!=-1){
//选择特殊跨度
el=document.getElementById(“特殊”);
}否则{
//其他选择正常范围
el=document.getElementById(“正常”);
}
//让它可见
el.style.display='inline';

它仍然显示具有正常id的跨距,我添加了一个控制台日志来检查它是否得到1,它是,但仍然显示具有正常id的跨距