隐藏 div 元素的一部分

Hiding part of div element

我有一个 div 元素,它会在单击按钮时填充,它看起来像这样。

http://localhost:8080/sample?q1=asd&q2=ads

我想隐藏特定的查询参数(这里说 q1)。我该怎么做?

我想要一个解决方案 js/jquery/html。

编辑: 更清楚一点,这就是我的 div 元素的样子,

<div>
  <pre>
  "curl -X GET --header Accept: application/json" "http://localhost:8080/sample?q1=asd&q2=ads"
  </pre>
<div>

当然,您甚至可以使用 JS 将显示的地址更改为任何您想要的地址:

history.replaceState(null, null, "/whatever url");

您也可以尝试修改location.search,但它也会刷新页面。