有一个带有文字的红色虚线框.如何定位当前日期(在 JavaScript 中?在那个盒子里

There's a Red Dashed Box With Text... How Do I Position The Current Date (In Javascript?) In That Box?

本文关键字:JavaScript 当前日期 盒子 定位 文字 红色 虚线 何定位 线框 有一个      更新时间:2023-09-26

这是问题所在:

日期位于左上角 - 非粗体,非红色。我的结果是让它加粗、红色和红色虚线边框框中。

我将getElementById属性设置为等于"datetext",这是红色段落文本中"p"标签的id。

我需要做什么才能根据此结果定位所有内容?

<p class="warning">
      <span>            
      WARNING: Due to recently being featured on T.V. we cannot guarantee supply.<br/>
        As of <p id="datetext"></p> we currently have product IN STOCK and ship within 24 hours.
      </span>

http://puregarcinaextract.net/

附言我已经为此投入了几个小时 - 如果您需要任何细节,请告诉我。

尝试一些这样的代码:

document.getElementById('datetext').innerHTML = new Date().toLocaleDateString();