I am trying to change the span with the input value what is the error on my code.
$(document).ready(function(){
if ($('#tnx-status').val() = 'publish'){
$("#status-p").html("Complited")
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input name="tnxst" type="hidden" id="tnx-status" value="publish" />
<span id="status-p"></span>