You should be careful to prevent xss when introducing html into the page.
That said, to what what you are asking, make sure to quote the model value, as jQuery expects a string. This will work.
$('#myDiv').html('@(new HtmlString(modelvalue))');
However, you should not.
You should instead use either a WYSIWYG editing library or whitelist accepted html from the user prior to inserting raw HTML. If it is not user based, then you should create a separate view with its own html structure, and then populate that with sanitized values; and then insert that view instead of the raw string.
If it is the case that you are somehow writing to the response stream directly, and the string produced is sanitized then you probably wouldn't have asked this rather basic question, so I am ruling that out.
)` when it should obviously be `$('#myDiv').html("
")`. `@Html.Raw` will output as-is, while `@Model.Value` will escape for you (the opposite of how it worked in asp.net) – freedomn-m Jan 30 '19 at 22:16