JSFiddle - React, Tailwind, and code Playground
HTML
<head>
<!-- jQueryの読み込み -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
</head>
<!-- 表示されてるURL -->
<div class="urltext">https://A.com/xxx/</div>
<!-- リンク -->
<a href="#" id="link">リンク</a>
<!-- jQuery -->
<script>
$(function() {
// 表示されてるURLのクラスを指示して
$('.urltext').on("load",function(){
// URLを取得して
var param = $(this).val();
// リンクを書き換え
$('#link').attr('href', 'https://B.com?param=' + param);
});
});
</script>