如何从html外部标签中删除文本?

时间:2018-10-13 23:42:42

标签: javascript jquery html

我的HTML中有两个括号。不知道它们来自哪里,但是有点烦人。试图将其删除,但是没有用。需要滚动到末尾才能看到括号

HTML:

<div class="panel-body">
<div class="form-group" style="display:none">
    <div class="col-md-3">
        <div class="label-wrapper">
            <label class="control-label" for="Id">Id</label>
        </div>
    </div>
    <div class="col-md-9">
        <div class="form-text-row">2</div>
    </div>
</div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ))

<div class="form-group">
    <div class="col-md-3">
        <div class="label-wrapper">
            <label class="control-label" for="Title">Title</label>
            <div title="Please enter the title" data-toggle="tooltip" class="ico-help">
                <i class="fa fa-question-circle"></i>
            </div>
        </div>
    </div>
    <div class="col-md-9">
        <input class="form-control text-box single-line" id="Title" name="Title" type="text" value="Sample Title">
            <span class="field-validation-valid" data-valmsg-for="Title" data-valmsg-replace="true"></span>
        </div>
    </div>
</div>

JavaScript删除括号:

$(document).ready(function () {
    var text = $('.panel-body').text();
    text.replace('))', '');
});

但是什么也没做。

1 个答案:

答案 0 :(得分:1)

您可以使用以下代码:

#calculate all next states
def nextState(state, state_total, values, lines, maxCap, cost, loss, pop_array, discount_rate):
  actions = [0]*state_total #actions for all states
  reward = 0

  print(lines)
  print(len(lines))

  prob = nextStateprob_calc(pop_array) #calculate probability
  reward = reward_calc(maxCap, lines, cost, loss) #calculate reward

  #find value iteration for given action
  for action in range(len(actions)):
    actions[action] += prob * (reward + discount_rate*values[state+1])
  return actions