将结果从一张卡(引导程序)发送到另一张

时间:2018-06-21 10:17:47

标签: twitter-bootstrap

嗨,我有2张卡(引导程序),我想点击案件信息,我会在第二张卡上显示一些文字 第一张卡:

<div class="col-lg-12 col-md-4">
    <div class="card">
      <div class="card-header">
        <h4 class="card-title">Cases Infos</h4>
        <p class="category">Parent - Child</p>
      </div>
    </div>
  </div>

第二张卡片:

<div class="col-lg-12 col-md-4">
    <div class="card">
      <div class="card-header">
        <p> text text </p>
      </div>

    </div>
  </div>

1 个答案:

答案 0 :(得分:0)

document.getElementById("asd").addEventListener('click',showData);

function showData(){
  document.getElementById("data").innerHTML="New Data"
}
<div class="col-lg-12 col-md-4">
    <div class="card">
      <div class="card-header">
        <p id="asd"> Show Case</p>
      </div>

    </div>
  </div>

<div class="col-lg-12 col-md-4">
    <div class="card">
      <div class="card-header">
        <p id="data"> text text </p>
      </div>

    </div>
  </div>