# Response Posts for Discussion Between Authors

**URL:** <https://discuss.write.as/t/response-posts-for-discussion-between-authors/1017>\
**Category:** Feature requests\
**Tags:** writeas\
**Created:** [December 27, 2019, 1:10pm UTC](https://discuss.write.as/t/response-posts-for-discussion-between-authors/1017 "2019-12-27T13:10:47Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![nibl](https://discuss.write.as/letter_avatar_proxy/v4/letter/n/4491bb/32.png) [@nibl](https://discuss.write.as/u/nibl)\
**Post date:** [January 4, 2020, 6:14pm UTC](https://discuss.write.as/t/response-posts-for-discussion-between-authors/1017/11 "2020-01-04T18:14:13Z")

</div>

Here is the code. The hashtag link is now clickable so you can quickly view responses and visitors can read how others have responded. Give it a try and let me know if it works for you. Instructions are included as comments in the code.

```
/* This code automatically inserts a hashtag below your post informing readers you are interested in response posts, and requesting they use a specific hashtag so you can find their response. There is also a mechanism to specify when you do not want a response.

Usage: Edit the "myResponseText" variable below to include your username or whatever text you want to display below posts.

When you don't want a response, type "responseno" anywhere in the post.

Tech note: By default, the text will be inserted above the first horizontal rule (<hr>, or "---" in markdown). This works with the default theme. If you insert horizontal rules in your markdown, you will need to change the code. If you use a different theme, you will need to check if and where it places horizontal rules.
*/

// EDIT this variable
var myResponseText = 'Responses welcome on Read Write.as using &#35;<a href="https://read.write.as/t/username">username</a>';

// Insert response hashtag on posts, but not on the homepage
// Check for post body id
if(document.getElementById("post-body")){

var content = document.getElementById("post-body").innerHTML;

var result = /responseno/i.test(content);

if (result) {
    var MyResponseTag = '<div style="margin-bottom: 2rem"><h3>No Responses Please</h3></div>';

var newContent = content.replace(/responseno/gi, "");

document.getElementById("post-body").innerHTML = newContent;

document.getElementsByTagName("hr")[0].insertAdjacentHTML('beforeBegin', MyResponseTag);
  }
  else {
    var MyResponseTag = '<div style="margin-bottom: 2rem"><h3>'+myResponseText+'</h3></div>';

document.getElementsByTagName("hr")[0].insertAdjacentHTML('beforeBegin', MyResponseTag);
  }
} else {

// remove responseno flag from homepage if displayed as part of post preview

 var bodyContent = document.getElementsByTagName("body")[0].innerHTML;

 var newBodyContent = bodyContent.replace(/responseno/gi, "");

 document.body.innerHTML = newBodyContent;

}
```

---

_[View the full topic](https://discuss.write.as/t/response-posts-for-discussion-between-authors/1017)._
