---
title: "Javascript Update Attribute"  
description: "Javascript Update Attribute"  
author: "Anonymous User"  
published: 2015-06-03  
updated: 2015-06-03  
canonical: https://www.mindstick.com/forum/23281/javascript-update-attribute  
category: "html"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# Javascript Update Attribute

<[input](https://www.mindstick.com/forum/159209/how-can-i-read-convert-an-input-stream-into-a-string-in-java) type="text" name="araButon" onKeyUp="return arama()" [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp)="[form](https://www.mindstick.com/forum/6/multi-form-mfc-application)-[control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) [filter](https://www.mindstick.com/forum/1176/filter-in-a-xml-file-in-c-sharp)" [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science)-filter="app" id="focusedInput"/>

I want to [update](https://www.mindstick.com/forum/156353/what-is-hummingbird-update) 'data-filter' [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) by [javascript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript)

I tried this [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) :

## Replies

### Reply by Anonymous User

You can use dataset or setAttribute,

```
// datasetdocument.getElementById('focusedInput').dataset.filter =
"test";// setAttributedocument.getElementById('focusedInput').setAttribute('data-filter',
'test-1');<input type="text" name="araButon"
onKeyUp="return arama()" class="form-control filter"
data-filter="app" id="focusedInput" />
```


---

Original Source: https://www.mindstick.com/forum/23281/javascript-update-attribute

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
