---
title: "How can I change document title to record from db with javascript?"  
description: "How can I change document title to record from db with javascript?"  
author: "Anonymous User"  
published: 2013-10-05  
updated: 2013-10-05  
canonical: https://www.mindstick.com/forum/1630/how-can-i-change-document-title-to-record-from-db-with-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How can I change document title to record from db with javascript?

I want to change the [document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool) [title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars) but cant get it to work. I am working with the following [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii):

```
echo "<input type='textbox' id='print' value='".$row['formuliernummer']."'>";
<script type="text/javascript">
var print = document.getElementById("print");
document.title = print;
</script>
```

\

The formuliernummer comes from a db.

## Replies

### Reply by Anonymous User

```
var print = document.getElementById("print").value;
```


---

Original Source: https://www.mindstick.com/forum/1630/how-can-i-change-document-title-to-record-from-db-with-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
