You can pass the value as a url fragment.
In your on click function, open '/profile.html#'+text
In your profile.html get the url fragment.
Sample code:
To navigate to profile.html
window.location.href = '<path to profile.html>' + '#' + text;
In profile(), to get the parameter, use
var text = window.location.hash.substring(1)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…